Is there a way to create a dynamic redirect to an external URL.

Something like the way I expected this to work:

public class MyAction extends Action {
  ...

     ActionForward fwd = new ActionForward("http://www.yahoo.com";, true);
     fwd.setContextRelative(false);
     return fwd;
        
  ...
}


The code in struts RequestProcessor ends up doing this:

        String uri = RequestUtils.forwardURL(request, forward);
        if (forward.getRedirect()) {
            response.sendRedirect
                (response.encodeRedirectURL(request.getContextPath() +
uri));
        } else {
            doForward(uri, request, response);
        }


So context relative does not seem to be checked, and the url ends up being

http://myserver:myport/myapp/http://www.yahoo.com

Is there a standard way to do this?

Or should I just call something like response.setRedirect().

Brendan

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to