struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <>
Subject Re: Request bean is lost
Date Wed, 07 Jul 2004 02:07:53 GMT wrote:

> I have an action that gets 3 lists from a database.
> It then places the lists inside a bean which is set in the request.
> The Page.jsp iterates thru the bean to display the data.
> The form is posted to the
> But before the PageForm.validate() is executed.
> Assume that an error is found...
> The response is returned 
> And this is where my bean is lost.
> Why?

(As mentioned your form bean won't be lost but the lists you put into 
the request would be. That's the nature of the request/response lifecycle).

> I do not want to store thr bean in the HTTP Session.

This is why I'm not so fond of the way Struts handles default validation 
with the validation framework - this problem comes up all the time in an 
application. In a case like this, I would opt for not having 
validate="true" in your config file for this action, and in instead 
manually call the validate method in your action. Then if validation 
fails you can make a query to yoru dao to return your Lists and forward 
back to the page. Probably best if you had a setUp() method in your 
Action which can be called to do this setup. You'd call it of course the 
first time you need to present the form, and then after manually calling 
the validate() method on the form, and validation fails, you'd call it 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message