Another possible solution is to use an OGNL expression as the value for the
"input" result element and use either a form property or a non-form action
property for the value.

You could also set the "inputResultName" on the workflow interceptor [1],
although that might not be as flexible of a solution: I'm not sure if the
value for that is parsed.

In general, though, using the same action/validation to process different
form submissions strikes me as a little fishy. It seems like things could be
re-architected or re-configured to make use of the underlying validation
and/or action processing without resorting to any trickery (albeit minor, in
this case).

d.

[1] http://struts.apache.org/2.x/docs/workflow-interceptor.html

--- Ted Husted <[EMAIL PROTECTED]> wrote:

> One of the results to the action stanza should be named "input". The
> "input" result is the one that is selected when validation fails.
> 
> For an individual action, it looks something like this:
> 
>         <action name="Login"  class="mailreader2.Login">
>             <result name="input">/Login.jsp</result>
> 
> A default input result can also be set for an entire package, and then
> changed for individual actions, as needed.
> 
>     <package name="subscription" namespace="/"
> extends="mailreader-support">
>         <global-results>
>             <result name="input">/Subscription.jsp</result>
>         </global-results>
> 
> HTH, Ted
> <http://www.StrutsMentor.com/>
> 
> On Jan 16, 2008 6:51 AM, Marcos Mendonça <[EMAIL PROTECTED]> wrote:
> > Hello
> >
> > I have two diferrent jsp for an action. Its works all right, only
> > problem is that, if there are validation errors it always returns to
> > the same jsp, and that sometimes it's not the jsp that posted the
> > data.
> >
> > What configuration I have to do in struts.xml or how to I decide on
> > the validate method wich jsp it will render on validation errors?
> >
> > Thanks
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> 
> --
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to