aspose file tools
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
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: 177

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 opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

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: 177

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: 13842

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: 177

yes correct
Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 159

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 opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

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: 447


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

 
 
subject: Can i call filter after particulate event?
 
Threads others viewed
Logout servlet problem with back button
Problem with Hibernate Cache
Setting response headers conditionally
Session Management
Getting logout to work effectively in jsp
MyEclipse, The Clear Choice