duckpuppy
Sep 11th, 2007, 02:40 PM
First off, I'm new to Spring and SpringMVC. I'm using 2.0.6 for this project.
I have a situation where I have three pages. My flow is as follows:
Page 1 - Very simple form (one element, a string). That string is used by a service in processFormSubmission to retrieve an object to be used as the model for page 3. An authorization check is then performed by another service - if the user is authorized to view that information, I need to go to the page 3 controller, with the object as the model (or at least available to be inserted into the model map). If the user is NOT authorized, go to page 2's controller. Both should be considered "success" views, as the error view is the same form with an "object not found, try again" style error message.
Page 2 (optional) - Display an audit form asking why the user needs the info. Log the reason in a database table using a logging service. Proceed to page 3 if the user chooses to continue past that point, return to page 1 if the user cancels.
Page 3 - use the object retrieved on page 1 to display detailed information.
I'm using JSPs for the views, with an InternalResourceViewResolver as the view resolver.
I can make each of those work independently - the problems I am having is how to redirect in the processFormSubmission of page 1 and, if necessary, page 2 so that the object from the first page is still available to be used as a model by page 3 AND each of the page's controllers are invoked, not just views.
This is the simple start of a much larger application. Also, I'm restricted with the requirement that there be NO client-side scripting - basic HTML markup only on the client, so doing the audit/reason step with client-side javascript is out.
I'd really appreciate any help here... the documentation, especially the examples, for SpringMVC is... sparse, especially for the 2.X releases.
I have a situation where I have three pages. My flow is as follows:
Page 1 - Very simple form (one element, a string). That string is used by a service in processFormSubmission to retrieve an object to be used as the model for page 3. An authorization check is then performed by another service - if the user is authorized to view that information, I need to go to the page 3 controller, with the object as the model (or at least available to be inserted into the model map). If the user is NOT authorized, go to page 2's controller. Both should be considered "success" views, as the error view is the same form with an "object not found, try again" style error message.
Page 2 (optional) - Display an audit form asking why the user needs the info. Log the reason in a database table using a logging service. Proceed to page 3 if the user chooses to continue past that point, return to page 1 if the user cancels.
Page 3 - use the object retrieved on page 1 to display detailed information.
I'm using JSPs for the views, with an InternalResourceViewResolver as the view resolver.
I can make each of those work independently - the problems I am having is how to redirect in the processFormSubmission of page 1 and, if necessary, page 2 so that the object from the first page is still available to be used as a model by page 3 AND each of the page's controllers are invoked, not just views.
This is the simple start of a much larger application. Also, I'm restricted with the requirement that there be NO client-side scripting - basic HTML markup only on the client, so doing the audit/reason step with client-side javascript is out.
I'd really appreciate any help here... the documentation, especially the examples, for SpringMVC is... sparse, especially for the 2.X releases.