tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michel <>
Subject Re: URL Rewrite
Date Sun, 05 Sep 2010 13:52:53 GMT

----- Original Message ----- 
From: "Konstantin Kolinko" <>
To: "Tomcat Users List" <>
Sent: Saturday, September 04, 2010 11:06 AM
Subject: Re: URL Rewrite

2010/9/4 michel <>:
> ----- Original Message ----- From: "Ognjen Blagojevic"
> <>
> To: "Tomcat Users List" <>
> Sent: Friday, September 03, 2010 6:42 AM
> Subject: Re: URL Rewrite
>> On 3.9.2010 12:02, michel wrote:
>>> I have been using the tuckey urlrewrite with some results, in that if I
>>> want to have an incoming URL coming in as
>>> gallery/pic20 gets changed to gallery.jsp?pic=20
>>> But the tool bar URL gets displayed as gallery.jsp?pic=20
>>> and I want to display gallery/pic20
>> Just use rule, not outbond-rule:
>> <rule>
>> <from>/gallery/pic([0-9]+)</from>
>> <to>/gallery.jsp?pic=$1</to>
>> </rule>
> Thanks, and I have it working at times (worked all day on this) but it 
> seems
> unreliable. I am expecting that the very same code would work if I had
> 'forward' or 'redirect', but it doesn't.

If you need a filter to be invoked not only on user's requests, but
also when processing forwards and includes inside of your own webapp,
you have to configure its mapping in web.xml so that those are passed
to it. See the Servlet spec for details.

If that is what you mean by forwards and redirects.

If you do a client-side redirect (sending a response with HTTP status
302 or 301, 303, 307), the URL where you sent your client will be
displayed in her browser's location bar.

Best regards,
Konstantin Kolinko

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

Konstantin, I fixed the problem! The problem was in the links in the HTML 
code. If I do a redirect, then the URL in http: shows the true URL, and the 
links in the page were using it for  building the reklative address.


with html code <img src="heading/can-post.gif"> is 

in a forward the http in the toolbar might be

so the image is

and it can't be found.

The solution is to have

 <base href=> in the page, so the URL building uses 
that instead of the misleading URL in the toolbar.


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

View raw message