> <result name="input">/xxx/MyWizardPage${page}.jsp</result>

oh yes, this does the trick! Thanks! 

I just found another problem when using xml based validation. In struts1, there 
is a page attribute, which can tell the validator to validate certain fields 
which belong to that page, but this useful feature is not in struts2, is there 
any replacement for that?





________________________________
From: Greg Lindholm <greg.lindh...@gmail.com>
To: Struts Users Mailing List <user@struts.apache.org>
Sent: Thursday, July 9, 2009 2:32:17 PM
Subject: Re: dynamic return when validation failed

>
>
> >
> > Well, if I remove my validation code in the validate() method and put it
> > into execute() method, then I can easily control which logical name to be
> > return, but I thought that is not a good way to do that right?
> >
>
> While this might not be a "good way to do that," it's what I would do and
> in
> fact have done.
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>

I occasionally have to do validation in the execute() method but always
prefer to do declarative validation with annotations wherever possible since
it is so much simpler and cleaner. This means all my actions have to be able
to handle an 'input' result. Since 'input' result is the standard for
validation errors you should be prepared for it as the next programmer who
works on your code may add a validation() method or add validation
annotations.

@OP: If you know which page# in a wizard sequence to return to and use that
page# in the jsp name then you can make that page# available with a
getPage() method and do this:

    <result name="input">/xxx/MyWizardPage${page}.jsp</result>

It does mean you would need to have a jsp page naming convention that
includes the page#.

Reply via email to