If you are using the released version of WW1.3 then it did not have dynamic view 
mapping, however in your case I think you can make it dynamic by using action chaining 
instead.
Make sure your action has a public metod getUrl() that should return the view you wish 
to redirect to (a.jsp or b.jsp).
Change your doExecute:
if(...) {
  return SUCCESS;
else {
   this.url = someDynamicJSPValue;
 return  REDIRECTVIEW;
}

In your actions/views file the REDIRECTVIEW should map to just the Redirect.action 
with no url specified. The url will be copied during the action chaining from your 
action and the redirect action should redirect to that view.

Another option is to just copy the 3-4 relevant lines from the Redirect action class 
and use them in your action. In that case the action should return NONE to do the 
redirect..

Cheers,

Dick Zetterberg
[EMAIL PROTECTED]

----- Original Message ----- 
From: "Hani Suleiman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 06, 2003 2:44 PM
Subject: Re: [OS-webwork] Dynamic redirect


> With both ww1 and 2, you can use variables in your actions.xml file
> 
> Eg: redirect.action?url=${myurl}
> 
> then in your action have a getMyurl() method.
> 
> On Nov 6, 2003, at 8:35 AM, Giovanni Formenti wrote:
> 
> > Hallo!
> > We need to redirect an action dynamically to a view different from that
> > specificated by SUCCESS (in the views.properties). Depending on some
> > condition, the doExecute() method must redirect the user to a specific 
> > view
> > (for example a.jsp if we have condition A or b.jsb if we have 
> > condition B
> > somethin like:
> > if(...) {
> >   return SUCCESS;
> > else {
> >   redirect to another
> > }
> > ).
> > It's possible?! Must we use redirect.action?url=xxxx but with xxxx 
> > changed
> > within the doExecute()?!
> >
> > Thanx for any help!
> > Gio



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to