lmc
May 14th, 2007, 03:45 AM
Hi all,
I'm a newbie at Spring, and I'm having problems with the AbstractWizardFormController class (maybe it's not the best option to solve my problem)
What I want to do is:
- have an initial page that uploads a file
- have a second page that shows the content of the file, so the user can review it and ask the data to be validated before storing it on a database
- have a third page where the user will have the final "Save" button to store the data in the database
My first approach was to have one SimpleFormController with its corresponding Validator for each page, but after implementing the 1st and the 2nd pages, I found a problem. On the first controller, I was able to read the file and store the data on a mapping bean (a simple bean class containing the data from the file). But when I go to the 2nd page, I have the data available in the mapping bean when first showing the page, but after pressing the "Validate" button in the form, the command object of the 2nd form does not contain the data I've already read (I had sessionForm set to true, used the same class for the command object, and named the command object for the 2 pages with the same name, but after some reading it seems that the second controller creates it's own new command object, so the mapping bean I've created in the first page is lost)
So then I tried the AbstractWizardFormController, but I'm facing another problem. On the AWFC, I am able to use the validators I had created before, but I don't know where in the AWFC I can process the page in the Controller before actually loading the next page. I mean, on my initial approach, I loaded the file data into my mapping bean on the onSubmit() method in the SFC of the first page, but now in AWFC I don't know which method can I use for that (the processFormSubmission method is marked final )
Can anyone please help?
Thank you very much
I'm a newbie at Spring, and I'm having problems with the AbstractWizardFormController class (maybe it's not the best option to solve my problem)
What I want to do is:
- have an initial page that uploads a file
- have a second page that shows the content of the file, so the user can review it and ask the data to be validated before storing it on a database
- have a third page where the user will have the final "Save" button to store the data in the database
My first approach was to have one SimpleFormController with its corresponding Validator for each page, but after implementing the 1st and the 2nd pages, I found a problem. On the first controller, I was able to read the file and store the data on a mapping bean (a simple bean class containing the data from the file). But when I go to the 2nd page, I have the data available in the mapping bean when first showing the page, but after pressing the "Validate" button in the form, the command object of the 2nd form does not contain the data I've already read (I had sessionForm set to true, used the same class for the command object, and named the command object for the 2 pages with the same name, but after some reading it seems that the second controller creates it's own new command object, so the mapping bean I've created in the first page is lost)
So then I tried the AbstractWizardFormController, but I'm facing another problem. On the AWFC, I am able to use the validators I had created before, but I don't know where in the AWFC I can process the page in the Controller before actually loading the next page. I mean, on my initial approach, I loaded the file data into my mapping bean on the onSubmit() method in the SFC of the first page, but now in AWFC I don't know which method can I use for that (the processFormSubmission method is marked final )
Can anyone please help?
Thank you very much