tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Problems upgrading to Tomcat 7
Date Tue, 31 Jul 2012 14:31:11 GMT
Alejandro Mehring wrote:
> Thank you very much for your help!
> Digging a bit more into the system, I came to a part where it's building
> the link based on the original servlet request.
> If I have this URL:
> http://host/app/servlet/FrontController?arg1=yes&arg2=target.jsp&arg3=something
> Java 1.4's getRequestURL() returns 'http://host/app/servlet/FrontController'
> whereas
> Java 1.6's getRequestURL() returns 'http://host/app/target.jsp'
> I found someone reporting this same issue on JBoss community page, but got
> no answer. I'll try to find another way to get the same behaviour in Java
> 1.6 as of getRequestURL in 1.4.

Now you seem to be on the right path.
On the other hand, you seem to be strangely ignoring every bit of advice that people are 
trying to give you, for example what Christopher suggested in his earlier message, and 
which i will repeat here :


Although this should work, I always recommend using context-relative
URLs like this:

<link type="text/css" href="<%=
response.encodeURL(request.getContextPath() + "/lightStyle.css") %>" />

This will ensure that your URLs resolve properly no matter how the
.jsp is being evaluated (for instance, in an include or after a
forward, where the client's URL may not match what your JSP expects).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message