Kevin,
Check this link out:
http://www-1.ibm.com/servlet/support/manager?rs=0&rt=0&org=SW&doc=1005783
It may be that you are using different versions of the Servlet
Specification supported by the container (v. 2.1 vs. 2.2 or 2.3) The
behavior you are seeing I think is correct for the 2.3 version.
The 2.2 spec is a little ambiguous.
In addition, you might also want to consider using
response.encodeRedirectURL() so that the URL is properly encoded if you
are doing any URL rewriting for session tracking.
-Richard
At 03:53 PM 9/6/01 -0400, you wrote:
>I call Response.sendRedirect() from my servlet.
>
>I'm sending the user back to the same servlet (the controller), so I use
>Request.getRequestURI().toString().
>
>Like so:
>res.sendRedirect( req.getRequestURI().toString() + "?action=groups" );
>
>On Tomcat 4 on NT the redirected URL looks correct:
>"http://server/webapp/appname/Servlet?foo=bar"
>
>On WebSphere 3.5 on OS/400 the redirected URL is wrong:
>"http://server/webapp/appname/webapp/appname/Servlet?foo=bar"
>
>In both containers, the value of req.getRequestURI().toString() is the same:
>"/webapp/appname/Servlet" (perfect)
>
>It seems that WebSphere is using "http://server/webapp/appname" as the base
>and is appending the request URI into it and producing the above result.
>
>Tomcat is using "http://server" as the base, so appending the request URI
>produces the desired result.
>
>My questions: Are both containers correct? Am I making an incorrect
>assumption about what the base should be?
>
>Any ideas?
>
>
>I am considering workarounds like passing the entire URL (getRequestURL)
>into the redirect instead of relative paths. I cannot use RequestDispather
>in this situation.
>
>--------------------
>Kevin Baynes
>Software Engineer
>[EMAIL PROTECTED]
>703-393-2191
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html