Hi Jason 

> Which version of 1.3 do you have? The released version or the latest
> CVS? I made a change to make the Redirect action not implement
> CommandDriven because I was getting this kind of problem when 
> trying to
> redirect from a CommandDriven action, because the Redirect action did
> not have a method for the Command which was executed on the Action.
> There was no real reason for Redirect to implement CommandDriven, so I
> removed this and things worked the way they should.
thanks for the hint. I worked with a cvs snapshot of the 10.3.2002, 
so your change slipped throuh. I've made the modification in the Redirect 
but it didn't solve my problem. 

I've investitgated the problem more accurate and found following:
A redirect from an action fails when we call addError() and after that we 
throw an Exception which should be processed as explained in my previous 
mail. If I remove the addError() method call the Exception will be processed
correctly and the Redirect is executed as desired. If we switch back to 
ww1.2 everything runs fine. It seems that something changed when an
Exception is 
thrown in an action/command after having called the addError() method.

I hope this helps to find the problem. Of course I'm more than glad to give
more info/help if needed to solve this problem.

Thanks for help.

Cheers
-Paolo

> > 
> > Hi all
> > 
> > After having migrated to WW 1.3 I came across following problem:
> > 
> > We use the Redirect action from within our actions/commands 
> > to redirect to an ErrorHandlingAction in case an Exception 
> > arises when executing an action/command. To do so we've 
> > overwritten the execute method in our base action class in 
> > following manner (abbreviated to get the idea):
> > 
> >    String execute()
> >    {
> >       try
> >       {
> >          return super.execute();
> >       }
> >       catch(Throwable e)
> >       {
> >          processException(e);
> >       }
> >    }
> > 
> > and the processException method looks roughly like this:
> > 
> >    protected void processException(Throwable ex)
> >    {
> >       ...
> >         String targetAction = "error.application.jspa";
> >             
> >         // redirect to the targetAction
> >         HttpServletRequest req = 
> > ActionContext.getContext().getRequest();
> >         String requestURL = req.getRequestURL().toString();
> >         String contextPath = req.getContextPath();
> >         String targetURL =
> >             requestURL.substring(
> >             0,
> >             (requestURL.indexOf(contextPath) + 
> contextPath.length()));
> >         // do the redirect
> >         Redirect redirect = 
> > (Redirect)ActionFactory.getAction("Redirect");
> > 
> >         redirect.setUrl(targetURL + "/" + targetAction);
> >         redirect.execute();
> >     }
> > 
> > This worked perfectly in 1.2.x for 'pure' actions (doExecute) 
> > and commands. 
> > But now using 1.3 the Redirect fails when happening from an 
> > command (a blank page is returned!). No problems at all when 
> > it happens in a doExecute(). As I mentioned above a blank 
> > page is returned (like a NONE view...) instead of calling the 
> > action which we wanted to redirect to.
> > 
> > For now this seems really to only incompatibility raised from 
> > migrating to 1.3 but it prevents us to fully switch. Could 
> > someone have a closer look on this issue?
> > 
> > Many TIA!
> > 
> > Cheers
> > -Paolo
> > 
> 
> 
> HTH,
> 
> Jason
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Does your code think in ink? 
> You could win a Tablet PC. Get a free Tablet PC hat just for playing. 
> What are you waiting for?
> http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> 


-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink? 
You could win a Tablet PC. Get a free Tablet PC hat just for playing. 
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to