PDA

View Full Version : Returning Updated Form View on Submit


jazman
Apr 23rd, 2007, 10:29 AM
Hi Guys,

I have a form and am using a simpleFormController. I pass object initially into the view via the formBackingObject() method. Then I update the relevant data on submit. Once the form is submitted it redirects to the success view, which at the moment is another page.

However what I want to do is reload the form page with the necessary updates and not redirect to a completely different page. I thought I could do this by passing in the name of the view in the ModelAndView method in the onSubmit method. Although this simply reloads a blank page without any of the previous data from the form backing object, nor the updated data.

How can I reload the current form with the new updates?

Very much appreciate any advice

Marten Deinum
Apr 23rd, 2007, 02:53 PM
call the showForm (http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/servlet/mvc/SimpleFormController.html#showForm(javax.servlet.h ttp.HttpServletRequest,%20javax.servlet.http.HttpS ervletResponse,%20org.springframework.validation.B indException)) method instead of returning a new ModelAndView.