tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Modifying the response
Date Thu, 02 Nov 2006 13:04:14 GMT
Tremal Naik wrote:
> 2006/11/2, Tremal Naik <>:
>> I'd like to filter the response to strip the unnecessary query string
>> from the Location header. Should I use a Valve or a Filter or what?
> I noticed that I can change the header Location after the invoke()
> call in a Valve:
> getNext().invoke(request, response);
> String location = response.getHeader("Location");
> if (location != null)
> {
>         response.setHeader("Location",
> "");
> }
> I don't get an IllegalStateException as I expected. Why?
> Do you think this is a correct way to proceed?
> thanks

Using a valve seems a bit crazy, even a filter seems excessive.

I'm not quite clear on what the problem is; is it that IE is
misbehaving, or is it that your app is gaining a query string where it's

If the query string is unnecessary, try to determine why it's getting
added to the end of the redirected url.  Your SSLExt may be
misconfigured, or not doing it's job properly - or the Struts components
doing something improperly.

If it's meant to be there, and the problem lies with IE you should
examine the request/response that is causing IE to 404.

You may find the IE Developer toolbar helpful, along with a close
examination of what happens on the server when IE tries to request the
URL in the redirected response.  E.g. configure an access log valve and
watch the log as each browser type hits the urls.  check that both see
the same thing.

(It might also be worth noting that Tomcat can automatically redirect to
a secure port, if you're using a Tomcat Realm/Auth implementation).

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message