> -----Original Message----- > From: Vedovato Paolo [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 19, 2003 8:26 AM > To: Webwork (E-Mail) > Subject: [OS-webwork] Redirect problems after migrating from > 1.2.x to 1.3 > > > 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 >
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. 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