In your action class, write a method like so:
public String input() {
// populate my dropdowns
return Action.INPUT;
}

Obviously you will have to write the code to populate your dropdowns there,
as that depends on what you are up to.  But the input() method of your
action class will be called if validation fails, so if you have things that
you want to make sure occur on validation failure, put them there.

jk

On Mon, Mar 2, 2009 at 1:30 PM, Sundararaman, Anand <
[email protected]> wrote:

> Hi,
>  Would you able to specify in little more detail? Sorry for that as I am
> new to Struts 2.
>
> Thanks,
> Anand
>
>
> -----Original Message-----
> From: Jim Kiley [mailto:[email protected]]
> Sent: Monday, March 02, 2009 12:23 PM
> To: Struts Users Mailing List
> Subject: Re: Struts 2 - After validation failure populating the drop downs
>
> Populating the dropdowns in an input() method that returns Action.INPUT
> should do the trick.
> jk
>
> On Mon, Mar 2, 2009 at 1:19 PM, Sundararaman, Anand <
> [email protected]> wrote:
>
> > Hi,
> >  I guess there is an elegant solution for this but I could not find out
> in
> > the user list.
> >
> > I am using Struts 2 and creating some form validations. If a validation
> > fails on a JSP screen, the input result takes back the control to the
> same
> > screen, but the drop downs are not populated. I need to know the best way
> of
> > showing the validation failures and also populating the drop downs.
> >
> > Thanks a Lot,
> >
> > Anand
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

Reply via email to