struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Kiley <jhki...@summa-tech.com>
Subject Re: Struts 2 - After validation failure populating the drop downs
Date Mon, 02 Mar 2009 18:37:14 GMT
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 <
Anand.Sundararaman@ps.net> 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:jhkiley@summa-tech.com]
> 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 <
> Anand.Sundararaman@ps.net> 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: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message