This is the reasons I sometimes have an action in my "input" action
attribute.  What I mean is:

<action path="/showForm.do"
    type="com.actions.ShowFormAction">
    <forward name="form" path="myForm.jsp"/>
</action>

<action path="/submitForm.do"
    type="com.actions.SubmitFormAction"
    name="myFormBean"
    input="/showForm.do">
    ...
</action>

I sometimes (often?) use the Action that generated the form as my input
because my form has controls that need to be initialized (like your drop
downs).
Using an Action as "input" sometimes takes more work.  Your action should
know that it's only redisplaying a form and not reset all form values (or
else the user will have to reinput everything instead of just correct the
validation error).  
You *can* avoid this by placing your list in session scope, like Mike
suggested.  If it's used often enough, you can put it in application scope,
though you'd have to define when "often enough" is justified.  
Try the session scope approach first.

hth,
Hubert

--- Ian Joyce <[EMAIL PROTECTED]> wrote:
> It's not slow, the lists are created from data from a database.  I am
> assuming when you say 'do it again' you mean add these Lists to the
> request.  Where should this be done at?
> 
> >>> [EMAIL PROTECTED] 01/31/04 01:48 AM >>>
> One way is to put them temporarily in the session.  But, why not just do it
> 
> again?  Is it too slow?
> 
> At 11:28 PM 1/30/2004, you wrote:
> >In my Action I am populating an ActionForm with data from a database.  I 
> >am also setting some additional request attributes with Lists of 
> >beans.  The purpose of these Lists are to create various drop down boxes 
> >in the form.  This works well, however when the form is submitted and 
> >validation fails these attributes are no longer in the request and the 
> >drop down boxes aren't created.
> >
> >What is the best way to have these Lists avaiable when the validation
> fails?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to