aspose file tools*
The moose likes Spring and the fly likes Handling multiple forms with spring 3 MVC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Handling multiple forms with spring 3 MVC" Watch "Handling multiple forms with spring 3 MVC" New topic
Author

Handling multiple forms with spring 3 MVC

suresh mandalapu
Ranch Hand

Joined: Sep 14, 2008
Posts: 32
HI , I am implementing user registration for a website where the registration process is a 5 step process each I need to get a form from client.
For ex. in 1st stage only username and password , in 2nd stage age and country , in 3rd stage email id , licence agreement ... etc.

I am able to handle each stage by using some model attribute and its validation, but I am not sure , in the 2nd stage , how to access form data got in 1st stage ?

My problem is after 5 stages are over i need to store all the data that I got in 5 stages in a single row in DB.

The problem I am able to handle each stage individually , but not sure how can I get data that i have read already in earlier stages ?

1) Is there any way that I can put data read in a session and access it after 5 stages are over ?

2) is there a way to use same bean for all stages ? the problem is i need to do validation on the data received from the bean . Right now I am handling a separate bean for every stage but it is not an efficient way ..

I want to use a common model bean for storing the data in all five stages but do only relevant validation on the data i got in each step ?

Can anybody clarify ?

thanks
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 537

Earlier in Spring, we had a AbstractWizardFormController, which was best suited for this type of requirement. Its deprecated from Spring 3.x onwards. Take a look at Spring Web Flow.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Handling multiple forms with spring 3 MVC