tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 8205] New: - request.getPort() returns wrong port after redirect
Date Wed, 17 Apr 2002 13:37:29 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8205>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8205

request.getPort() returns wrong port after redirect

           Summary: request.getPort() returns wrong port after redirect
           Product: Tomcat 4
           Version: 4.0.3 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: gary.mullenschultz@kingland.com


I am running on Tomcat 4.0.3, using the standalone server.

We do multiple redirects in our server, across Tomcat instances.  We are
encountering failure in the following scenario.

Let's say we have two Tomcat instances: A on port 81, and B on port 82.  A
contains one JSP in the root webapp: SendRedirect.jsp.  B contains two JSPs
in the root webapp: ReceiveAndSendRedirect.jsp and ReceiveRedirect.jsp.  The
source is as follows:

SendRedirect.jsp:
<%
response.sendRedirect("http://127.0.0.1:82//ReceiveAndSendRedirect.jsp");
%>


ReceiveAndSendRedirect.jsp:
<%
response.sendRedirect("ReceiveRedirect.jsp");
%>

ReceiveRedirect.jsp:
<html><body>
This is ReceiveRedirect!
</body></html>

What ends up happening is that the sendRedirect method inside
ReceiveAndSendRedirect.jsp builds a URL that looks like this:
http://127.0.0.1:81//ReceiveRedirect.jsp

There *is* no ReceiveRedirect.jsp on instance A (port 81), and a 404
results.

In debug mode, a call to request.getPort() inside ReceiveAndSendRedirect.jsp
returns 81; given that it's a redirect (not a forward), I would have thought
it would return 82 (the port of the "current" server).

Any ideas?  Am I just confused?  If so, how can I easily do this multiple
redirection (it gets invoked when our security code kicks in).

Thanks, Gary Mullen-Schultz, Kingland Systems

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message