tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: How to prevent Tomcat redirect my request
Date Fri, 21 Nov 2008 17:08:54 GMT
jim ma wrote:
>> Tell your clients to generate URLs like:
>> http://host/your_servlet?url=url_to_fetch
>> In other words you should implemet proxy that will handle redirects itself.
>> Finally, your clients will not see any 302 redirects.
> 
> 
> I like this idea.  It is greatly helpful  , I think it works for my problem.
> 
That is a cute idea.

Here is another one :

First, I am not telling you that you should put an Apache in front of 
your Tomcat just for this. (*)

But, if you are anyway planning to put an Apache in front of your Tomcat 
for any reason (load balancing, serving other types of content, cgi, 
..), then
in Apache you can easily "catch" a request before it gets directed to 
any directory (or to Tomcat), in time to rewrite the URL internally 
(thus without sending a 302 to the client).

In Apache, mod_rewrite can be set up to act at the Server level, very 
early in the request cycle (RewriteCond, RewriteRule directives).
You can also do all sorts of subtle things with mod_perl handlers.






(*) I was tempted to do just that, just to provoke a blasting reply from 
Chuck or Chris, but I won't.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message