This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes Can i call filter after particulate event? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Can i call filter after particulate event?" Watch "Can i call filter after particulate event?" New topic
Author

Can i call filter after particulate event?

mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 233

Hi can i call a filter after a event, say i have a logout link and it is redirecting to lo-gout servlet where i am removing all session attributes like this


is that possible or any why to clear cache after logout link is pressed..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

You don't call filters -- they are automatically invoked to bracket mapped requests. Why do you need to call a filter? Just refactor the code so that it can be called as a method.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 233

i want to clear all jsp cache after logout. if i use methode is it clear all my JSP cache?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

It appears to me that your question is actually "How do I clear my JSP cache (whatever that is) from Java code in a servlet or filter?" Is that right?
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 233

yes correct
Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 162

You could have the same logic within a method to clear your JSP, servlets cache when you wanted to do so. Actually by calling appropriate session.invalidate(), will clear all session stored items for a particular session.


No pain, No gain.
OCJP 1.6
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

The session has nothing at all to do with the cache, so invalidating the session will have no effect not he cache.

See the ServletsFaq for information on setting cache headers.
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 457


say i have a logout link and it is redirecting to lo-gout servlet


You can configure filters to intercept request/responses before reaching/coming from the servlet. So, upon clicking "logout" it is expected to go to servlet and you can configure a filter before it goes to the actual servlet.

But this has nothing to do with clearing cache. As Bear pointed out, you need to refer the link he provided.


Regards
KumarRaja

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can i call filter after particulate event?
 
Similar Threads
Logout servlet problem with back button
Session Management
Problem with Hibernate Cache
Getting logout to work effectively in jsp
Setting response headers conditionally