Example usage for org.springframework.web.bind.support SessionStatus setComplete

List of usage examples for org.springframework.web.bind.support SessionStatus setComplete

Introduction

In this page you can find the example usage for org.springframework.web.bind.support SessionStatus setComplete.

Prototype

void setComplete();

Source Link

Document

Mark the current handler's session processing as complete, allowing for cleanup of session attributes.

Usage

From source file:cherry.example.web.applied.ex60.AppliedEx61ControllerImpl.java

@Override
public ModelAndView start(AppliedEx61SessionForm form, BindingResult binding, Authentication auth,
        Locale locale, SitePreference sitePref, NativeWebRequest request, SessionStatus status) {
    if (binding.hasErrors()) {
        status.setComplete();
        return redirect(redirectToSearchResult()).build();
    }/* w w w .  j  ava  2s  .  com*/
    AppliedEx61Form f = createForm(form);
    if (f.getItem().isEmpty()) {
        status.setComplete();
        return redirect(redirectToSearchResult()).build();
    }
    return withViewname(viewnameOfStart).addObject(f).build();
}

From source file:com.rambird.miles.web.VisitController.java

@RequestMapping(value = "/owners/{ownerId}/pets/{petId}/visits/new", method = RequestMethod.POST)
public String processNewVisitForm(@Valid Visit visit, BindingResult result, SessionStatus status) {
    if (result.hasErrors()) {
        return "pets/createOrUpdateVisitForm";
    } else {/* w ww  . j  a  v a 2  s  .c om*/
        this.rambirdService.saveVisit(visit);
        status.setComplete();
        return "redirect:/owners/{ownerId}";
    }
}

From source file:com.pet.demo.web.VisitController.java

@RequestMapping(value = "/owners/{ownerId}/pets/{petId}/visits/new", method = RequestMethod.POST)
public String processNewVisitForm(@Valid Visit visit, BindingResult result, SessionStatus status) {
    if (result.hasErrors()) {
        return "pets/createOrUpdateVisitForm";
    } else {/*from  w w w . j  av  a2 s .c  om*/
        this.petdemoService.saveVisit(visit);
        status.setComplete();
        return "redirect:/owners/{ownerId}";
    }
}

From source file:cherry.example.web.basic.ex50.BasicEx51ControllerImpl.java

@Override
public ModelAndView start(BasicEx51SessionForm form, BindingResult binding, Authentication auth, Locale locale,
        SitePreference sitePref, NativeWebRequest request, SessionStatus status) {
    if (binding.hasErrors()) {
        status.setComplete();
        return redirect(redirectToSearchResult()).build();
    }//from w  w  w  .j  a va 2s.com
    BasicEx51Form f = createForm(form);
    if (f.getItem().isEmpty()) {
        status.setComplete();
        return redirect(redirectToSearchResult()).build();
    }
    return withViewname(viewnameOfStart).addObject(f).build();
}

From source file:cherry.example.web.basic.ex50.BasicEx51ControllerImpl.java

@Override
public ModelAndView completed(BasicEx51SessionForm form, BindingResult binding, Authentication auth,
        Locale locale, SitePreference sitePref, NativeWebRequest request, SessionStatus status) {
    if (binding.hasErrors()) {
        status.setComplete();
        return redirect(redirectToSearchResult()).build();
    }/*from   ww w  .  j  a v a2 s. c  o  m*/
    BasicEx51Form f = createForm(form);
    if (f.getItem().isEmpty()) {
        status.setComplete();
        return redirect(redirectToSearchResult()).build();
    }
    return withoutView().addObject(f).build();
}

From source file:cherry.example.web.basic.ex60.BasicEx61ControllerImpl.java

@Override
public ModelAndView init(String redirTo, BasicEx60to61Form form, BindingResult binding, Authentication auth,
        Locale locale, SitePreference sitePref, NativeWebRequest request, SessionStatus status) {
    if (StringUtils.isNotEmpty(redirTo)) {
        status.setComplete();
        return redirect(redirectTo(redirTo)).build();
    }//  w w w  .j a  v a  2 s .c om
    if (binding.hasErrors()) {
        status.setComplete();
        return redirect(redirectToSearchResult()).build();
    }

    BasicEx61SessionForm f = createSessionForm(form);
    return redirect(redirectToStart()).addObject(f).build();
}

From source file:cherry.example.web.applied.ex50.AppliedEx51ControllerImpl.java

@Override
public ModelAndView init(String redirTo, AppliedEx50to51Form form, BindingResult binding, Authentication auth,
        Locale locale, SitePreference sitePref, NativeWebRequest request, SessionStatus status) {
    if (StringUtils.isNotEmpty(redirTo)) {
        status.setComplete();
        return redirect(redirectTo(redirTo)).build();
    }/*from   w w w  .ja  v a2  s  .  c om*/
    if (binding.hasErrors()) {
        status.setComplete();
        return redirect(redirectToSearchResult()).build();
    }

    AppliedEx51SessionForm f = createSessionForm(form);
    return redirect(redirectToStart()).addObject(f).build();
}

From source file:de.berlios.jhelpdesk.web.ticket.TicketNewWizardController.java

private String processFinnish(Ticket ticket, SessionStatus status) throws Exception {
    ticketDAO.save(ticket);/*w  w w  .  j  av  a  2 s .  co m*/
    status.setComplete();
    return "redirect:/tickets/" + ticket.getTicketId() + "/details.html";
}

From source file:cherry.example.web.applied.ex60.AppliedEx61ControllerImpl.java

@Override
public ModelAndView init(String redirTo, AppliedEx60to61Form form, BindingResult binding, Authentication auth,
        Locale locale, SitePreference sitePref, NativeWebRequest request, SessionStatus status) {
    if (StringUtils.isNotEmpty(redirTo)) {
        status.setComplete();
        return redirect(redirectTo(redirTo)).build();
    }//from   w  ww . j  a  va  2  s  .  co m
    if (binding.hasErrors()) {
        status.setComplete();
        return redirect(redirectToSearchResult()).build();
    }

    AppliedEx61SessionForm f = createSessionForm(form);
    return redirect(redirectToStart()).addObject(f).build();
}

From source file:lcn.samples.petclinic.controller.PetController.java

@RequestMapping(value = "/owners/{ownerId}/pets/new", method = RequestMethod.POST)
public String processCreationForm(@ModelAttribute("pet") Pet pet, BindingResult result, SessionStatus status) {
    new PetValidator().validate(pet, result);
    if (result.hasErrors()) {
        return "pets/createOrUpdatePetForm";
    } else {//from  w w w .  ja v a 2  s  .co  m
        this.clinicService.savePet(pet);
        status.setComplete();
        return "redirect:/owners/{ownerId}.do";
    }
}