You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Reumann <ma...@reumann.net> on 2002/09/03 17:46:14 UTC

How to handle this without using Session scope?

I have a DynValidatorForm set up for an Employee. One of the fields in
this form is 'states' as an ArrayList which contains State beans (for
abbreviation, and full state name). In my Action form the Dynamic Form
is first set with the ArrayList of states then it forwards to the jsp
page for entering the employee information.

The problem is when the form is validated and there are errors it
returns back to the input page, but the list of States is no longer
there. It makes sense that it's not there since it must be losing the
handle to the states since the actions only have request scope. Is
there a way to get the list of states to show up again by still using
request scope? Or do I need to set the States list or the Employee
dynamic form into session scope? I could also just put the states list
into the ServletContext which I have done before, but there must be a
good solution I am overlooking for doing all of this with request
scope. (For example what if it was a list of cars the user had to
select from, I might not want that car list in session scope).

Thanks for any help.

-- 

Rick
mailto:maillist@reumann.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to handle this without using Session scope?

Posted by Rick Reumann <ma...@reumann.net>.

On Tuesday, September 3, 2002, 11:46:14 AM, Rick wrote:

RR> i but there must be a good solution I am overlooking for doing all
RR> of this with request scope. (For example what if it was a list of
RR> cars the user had to select from, I might not want that car list
RR> in session scope).

    Doh... I'm an idiot. I can just set it all up in the reset
    method:) Sorry ...must have been the long weekend....

    Oops and sorry I forgot the subject line modifier:)


-- 

Rick
mailto:maillist@reumann.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to handle this without using Session scope?

Posted by Rick Reumann <ma...@reumann.net>.

On Tuesday, September 3, 2002, 11:46:14 AM, Rick wrote:

RR> but there must be a good solution I am overlooking for doing all
RR> of this with request scope.

    What actually would be ideal is if I could somehow set it in the
    DynaForm like I do for some other string properties

    <form-property name="states"
       type="java.util.ArrayList" intial="???some method call?" />
    <form-property name="departments"
       type="java.util.ArrayList" intial="???some method call?" />

   I know how to do the above for normal string properties and for
   string arrays but wouldn't know how to set the ArrayLists.

   Any ideas?

   Thanks

-- 

Rick
mailto:maillist@reumann.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>