Sep 3rd, 2008, 02:26 PM
Data for dynamic menus on formView
I want to display a form that has a couple of dynamically built menus and I want to use the
same form for both formView and successView. I can build the lists that drive menu
construction in the onSubmit method and pass them to the jsp via the ModelAndView return
object for a POST but I can't see how this is done for a GET where Spring just wants to pass a form
back to the UI.
How do I build the objects that will be used to create the menus for a GET and associate them
with the formView?
Thanks for any help or advice,
Sep 4th, 2008, 03:57 AM
Override isFormSubmission(HttpServletRequest request)...
... assuming you've extended SimpleFormController.
By default get request do not call onSubmit. Just get this method to return true and onSubmit would be called.
Alternatively you could override referenceData(HttpServletRequest request) and build your menu lists in there as this always gets called.