Hi,

Recent changes to Tomcat altered the behavior of our applications a bit so I've 
got couple of questions. The versions in questions are 7.0.64 and 7.0.67. I am 
aware of which is also described in the changelog for 7.0.67.

I have a filter acts on application "/myapp" that does a redirect in the 
following manner:

httpResponse.sendRedirect("login?a=b&c=d")

In Tomcat 7.0.65 I can see the following flow (the text after the 302 below is 
the value of the "Location" header as seen by network sniffer):

GET http://hostname/myapp?m=n&o=p  
              ==> 302: "http://hostname/myapp/?m=n&o=p";
GET http://hostname/myapp/?m=n&o=p 
              ==> 302: "http://hostname/myapp/login?a=b&c=d";

The first redirect adds a trailing slash after "myapp", the second is generated 
by my redirect

In Tomcat 7.0.67 with no "useRelativeRedirects" set on the context (which 
defaults it to "true"), I see

GET http://hostname/myapp?m=n&o=p 
              ==> 302: "login?a=b&c=d"

Now, this is expected behavior given the fix for [1]

However, with useRelativeRedirects="false" I see

GET http://hostname/myapp?m=n&o=p 
              ==> 302: "http://hostname/login?a=b&c=d";

The questions I have are 2: First, what happened with the trailing slash 
redirect. I vaguely remember discussions around it but I couldn't find them on 
the mailing list search index. And secondly but more importantly, in 7.0.64, 
the HttpServletRequest.sendRedirect() would use the application name to form 
the Location header value (as in .../myapp/login...) whereas in 7.0.67 the name 
of the application is missing from the absolute redirect.

Is there any way to work around this and to have 7.0.67 behave like 7.0.64?

George

[1] http://bz.apache.org/bugzilla/show_bug.cgi?id=56917
[2] https://tomcat.apache.org/tomcat-7.0-doc/changelog.html

Reply via email to