This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes Spring MVC Noob question: Heirarchical edit/view flow? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring MVC Noob question: Heirarchical edit/view flow?" Watch "Spring MVC Noob question: Heirarchical edit/view flow?" New topic
Author

Spring MVC Noob question: Heirarchical edit/view flow?

Philippe Desrosiers
Ranch Hand

Joined: Mar 29, 2006
Posts: 138
I'm trying to set up an MVC controller that will initialize the underlying command ONLY when a new form is displayed.

Basically, the user arrives at the "edit" page for an image gallery by specifying a request parameter like "galleryId". Within the page, I have a bunch of filters the user can set using SELECT lists, etc. These controls are bound to the underlying command, but the list of images being displayed as a result of the command is just placed in the request attributes by the controller.

So I want the controller to initialize the command when it sees a request for a new form, and initialize the image list based on the value of the "galleryId" parameter. On subsequent post-backs (such as when the user filters the list of images by submitting the underlying command), I want the controller to take the existing command, and "re-generate" the image list.

I'm trying to use a combination of formBackingObject, to initialize the command when a new form is requested, and onSubmit(request, response, Object, BindException) when the user submits a filter parameter on subsequent post-backs. But formBackingObject is called on every request, so this approach is not working at all.

How the heck can I do this? I know it seems like the most basic question, but every Spring MVC tutorial I can google seems to deal with Kindergarten-level application examples, and none of them has any kind of parallel to this functionality (select a gallery from a list, proceed to a "view" page for the gallery, filter the "gallery view", proceed to a "view" page for an image, etc. Basic hierarchical stuff).

Please help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring MVC Noob question: Heirarchical edit/view flow?
 
Similar Threads
print date format in Velocity Spring MVC
Session expire problem with HttpSessionListener
Spring MVC - A novice doubt
Question on Spring Security & Spring MVC.
MVC Model 2 vs Spring SimpleFormController (Why formBackingObject() gets called twice?)