Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving FormBean in Request Scope for multi-request workflow

Status
Not open for further replies.

ben4711

Programmer
Sep 17, 2005
1
AT
Hi!

I'm trying to use the request scope for a wizard-like form, spread over several pages. By using the request scope, I want to avoid side-effects detected by using session scope.

The problem is, that the data gets lost, no matter what I do. The form is submitted to an action where the data is still there. At the end of the action, I put the FormBean back into the request scope by using

Code:
request.setAttribute("formBean", formBean);

Unfortunately the data is lost nevertheless on the next page/action.

Is it right, that I MUST use session scope for multi-request forms or is there something else wrong in my code? I think Struts reinitializes the FormBean, right?

I appreciate every hint, thanks!
Ben
 
Try using the session scope. So that you store the bean in a session:

session.setAttribute("formbean", formBean);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top