posted 23 years ago
Hi,
I am using JavaBeans to handle HTML form submissions, and have things set up so that an initial form submits to a validation page, which creates a JavaBean in request scope from the parameters in the request. This page uses the bean to do some validation, and then does one of two things:
1. If everything is valid it forwards to a confirmation page, which uses the information in the bean to reprint the entered values (this page has access to the bean because it is forwarded).
2. If there is a problem, it uses the bean to print out errors and redisplay the form, with all previously entered values intact.
Here is a picture of the flow:
form.jsp
|
| (VIA FORM ACTION)
|
V
validate.jsp
|
| (VIA FORWARD)
|
V
confirmation.jsp
Now my problem: I want to put something on the confirmation page that says "Is this correct?" and allow the user to go back to the initial form page if it is not. However, I would like this initial page to be populated with the values already entered, again using the JavaBean.
In order to accomplish this, I would like to move the bean from request scope to session scope, and then have the initial page look for it there. If possible, I would like to have the initial page simply have a useBean tag that locates the bean.
So, after all this, my question: is there a way to manually put a bean in session scope so that a useBean tag can find it?
Thanks...
Buzz Andersen