• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can i call filter after particulate event?

 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to clear all jsp cache after logout. if i use methode is it clear all my JSP cache?
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes correct
 
Kumaravadivel Subramani
Ranch Hand
Posts: 171
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic