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-achieve-url-maxtry-filter-in-apache-tomcat
Date Tue, 28 Aug 2012 07:07:52 GMT
rathinasamy.r.s@snovabits.net wrote:
> No, not bothering about the interuption. As of now if an order comes 
> generate an url and return back with a maximum try for 2 times and time 
> to live for 15 minutes.

Let`s restart this from the beginning.

1) Unless you have a specific webapp and a specific servlet configured to serve these 
URLs, Tomcat is going to serve them with its default webapp and default servlet, whose 
purpose is to serve static files stored in the filesystem.  This default webapp/servlet 
does not count the number of times the file has been served, nor take into account the age

of the file etc..

2) if you want a different behaviour for those static files, you can either
   a) add a filter to the default webapp, so that before letting the default servlet 
return a static file, it will take into account some kind of counter or timer, and take 
some action based on that (return a "not found" response, delete the file, whatever), 
before the default servlet runs and returns the file
   or b) create your own webapp/servlet that will return these files (or not) depending on

your criteria.  And then map this webapp/servlet to the appropriate URL sub-space (where 
your files are created to be downloaded).

Either way, there is no standard (Tomcat-included) servlet or servlet filter that does 
this, so you will have to write your own code.  Is that part clear ?


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


Mime
View raw message