On 28 Aug 2012, at 05:00, "rathinasamy....@snovabits.net"
<rathinasamy....@snovabits.net> wrote:

> No It can't be responsible for removing the url, since the url path will
> not come through my application it is directly hitting the tomcat port.

That makes no sense.
If it's your app then you can intercept it and do as you please.


> I deployed my application as a war file in server & through that app
> created a folder in:
>
> tomcat_server_home/webapps/root/club/dely/ios/......

Do you mean root or ROOT?


> So how can I control it through app, My app's work is to generate a
> folder like structure in tomcat home path & build the url & return the
> url to user.

By adding a Servlet Filter with a path that maps to the same URL space
as the resource URLs.

If the Filter has access to the URL and counter, again as previously
described, then it can pass requests through transparently, increment
the counter and then refuse access by returning a 404 instead of a
response after the expiry time or counter is exceeded.

Look at the Tomcat examples and read the Servlet Spec - don't just
rely on Google and people on the list doing your work for you if you
want to understand this.


p


> On 8/27/2012 6:38 PM, Pid wrote:
>> On 27/08/2012 08:17, rathinasamy....@snovabits.net wrote:
>>> Hi,
>>>
>>> Many thanks for your reply.
>>>
>>> I am asking something which should be done in apache tomcat configurations, 
>>> Since I have not able to control that maxtry concept through my application
>>> (it is out of my app control)
>> There's no Tomcat or Servlet config to do this.
>>
>>> Through my app just generate a url to access a video file at run time, & 
>>> may be the user can copy that url and paste it in outside browsers - here I 
>>> have to control
>>> the usage of using my url which I have given to the user.
>> If your app is generating the URL, why can't it also be responsible for
>> removing it?
>>
>>> That url is something looks like 
>>> (http://localhost:8080/Club/dely/ios/item/42/23/cc.mp4) & it should 
>>> accessed via apache tomcat, so I am asking here for anyway to
>>> expire the url path in apache tomcat using filters
>>>
>>> like:
>>>
>>>  <init-param>
>>>     <param-name>ExpiresByType image</param-name>
>>>     <param-value>access plus 2 minutes</param-value>
>>>  </init-param>
>>>  <init-param>
>>>
>>> But it expires image & after 2 minutes, I need to expires some url pattern 
>>> after 2 access.
>>>
>>> Thank you again for spending your time in this.
>> Write a filter that blocks that URL after 3 accesses or 2 minutes
>> (perhaps using the suggestion by Joseph).
>>
>>
>> p
>>
>>
>>> Regards,
>>> Rathinasamy.
>>>
>>>
>>> On 8/27/2012 12:34 PM, Joseph wrote:
>>>> Have u tried to use regex to filter URL ,use concurrent hash map and 
>>>> atomic int to count?
>>>>
>>>> 在 2012-8-27,13:30,"rathinasamy....@snovabits.net" 
>>>> <rathinasamy....@snovabits.net> 写道:
>>>>
>>>>> Hi everyone,
>>>>>
>>>>> Please give me some ideas to achieve maxtry concept.
>>>>>
>>>>> I want to destroy the url path after some amount of access.
>>>>>
>>>>> For eg., if I give maxtry = 2 for the run time generated url 
>>>>> (http://localhost:8080/Club/dely/ios/item/42/23/cc.mp4), After the two 
>>>>> times access of the above url for the third time that url path will not 
>>>>> be able to access for anyone.
>>>>>
>>>>> _My environment is:_
>>>>>
>>>>> Apache-tomcat-7.0.25*
>>>>> *Windows 7
>>>>> 32 bit Operating system
>>>>>
>>>>> How to achieve this using apache filter?
>>>>>
>>>>> Thanks in advance,
>>>>> Rathinasamy.
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>

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

Reply via email to