struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hubert Rabago <hrab...@gmail.com>
Subject Re: Beans in Request and Validation Question
Date Tue, 01 Nov 2005 19:42:10 GMT
The way I dealt with this was to point my "input" attribute to a setup
Action which would put the needed collection into request scope for
me.  But that's just one approach.  Another is to handle validation
yourself (which really is very easy).  This is the approach
recommended by http://www.reumann.net/struts/articles/request_lists.jsp.
 That page actually lists a few approaches, though I would shorten my
list to the last three (plus the setup input Action).

Hubert

On 11/1/05, Jim Reynolds <jim.jreynold@gmail.com> wrote:
> I have a question about using request scoped beans and validation with an
> ActionForm.
>  Here is a example:
> In a certain action, I go and create a Collection of objects for a select
> list. I put the Collection into the request, and forward to a JSP page, and
> I show the list.
>  From the JSP page, the user is required to select an item from the select
> list, then hit submit. Here is where the issues come into play. From that
> action I am validating the form in the bean. If the user forgot to select an
> item, I create ActionError, stuff it into the ActionErrors object and send
> back to my input which is the original jsp page with the select list, the
> one they just submitted from.
>  But of course, when it goes back to the jsp page, there is no collection to
> build the select list, and I get errors. Up to now, I have been putting
> those types of list into the session, but really feel there should be a
> better way. Can anyone possibly guide me here to a better way to handle
> this?
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message