tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: How to prevent Tomcat redirect my request
Date Thu, 20 Nov 2008 14:24:30 GMT
jim ma wrote:
> On Thu, Nov 20, 2008 at 6:48 PM, André Warnier <> wrote:
>> Mikolaj Rydzewski wrote:
>>> jim ma wrote:
>>>> I still want to know if it is possible to  stop Tomcat from redirecting.
>>>> If
>>>> yes, that will be zero code effort for our current implementation.
>>> Why is it a problem for you to use http://localhost:8080/foo/ URL?
>>>  I agree with the above, but in case it is not an option, you may want to
>> look at something like this :
>> It does many more things, but I guess it can rewrite "/foo" into "/foo/"
>> internally too.
>  I  just debugged the code. It returns http status code 302 and redirected
> location  http://localhost:8080/foo/ before reach the code related to url
> rewrite configuration in web.xml .
Yes, that's true of course. Stupid me.
Urlrewrite is a servlet filter, so it will not see the request before it 
has been directed to the webapp, and thus the redirect will happen before.
I guess you would need some kind of re-directing Valve for that.

Now, about what Mikolaj wrote before (using the /foo/ URL) I think you 
misunderstand what he is saying.
What he meant is probably this :
You seem to be using a http client that is not a browser, but some kind 
of program or module.  Can you not make sure that this program or module 
does not send URLs like "/foo", but itself transforms them into "/foo/" 
at the source ?

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

View raw message