Announcement Announcement Module
Collapse
No announcement yet.
Why does 'update()' not redirect to 'sox' using @ModelAttribute in Spring MVC 3.0? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why does 'update()' not redirect to 'sox' using @ModelAttribute in Spring MVC 3.0?

    I am trying to test redirecting from the update method back to the sox method. But instead I get an error complaining about a missing "update.jsp".

    Code:
    	@RequestMapping(value = "/sox/update", method = RequestMethod.POST)
    	@ModelAttribute("formWrapper")
    	public final String update(HttpServletRequest request, 
    	 @ModelAttribute("formWrapper") FormWrapper formWrapper,
    		BindingResult bindResult,
    		ModelMap model)
    	{
    		return "redirect:/sox";
    	}
    
    	@ModelAttribute("formWrapper")
    	FormWrapper setupForm()
    	{
    		FormWrapper formWrapper = new FormWrapper();
    		return formWrapper;
    	}
     
    	@RequestMapping(value = "/sox", method = RequestMethod.GET)
    	public final String sox(HttpServletRequest request, ModelMap model)
    	{
    		return "sox";
    	}
    Last edited by Michael O'Connor; May 3rd, 2011, 10:44 AM.
Working...
X