tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mullen-Schultz, Gary" <>
Subject request.getPort() returns wrong port after redirect
Date Tue, 16 Apr 2002 19:39:14 GMT
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:



This is ReceiveRedirect!

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

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

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

View raw message