This is a known bug and will be fixed before 1.1 is released.

David






From: [EMAIL PROTECTED]
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Dynamic redirect to external URL
Date: Wed, 13 Nov 2002 14:23:56 -0800

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>

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


--
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