Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletFilter not being called

 
Alex Ryan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone tell me what is wrong with the following web.xml entry?
I want my ServletFilter to be called for every HttpRequest of any servlet or any JSP page but it is definitely not getting called for servlets in one specific scenario ... when the HttpSession is dead.
When the HttpSession is alive it seems to work.
However, if I issue a request from a page on my browser that has been left sitting for a while it seems to bypass the filter and go directly to the servlet which causes my application to crash.

I am perplexed at how to solve this problem and would be very grateful if anyone who understands Tomcat could tell me how to FORCE tomcat to use the filter in all circumstances.



 
Charles 'King
Ranch Hand
Posts: 56
Eclipse IDE Postgres Database Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check your DD syntax.

replace this: <servlet-name>*</servlet-name>

with: <url-pattern>/*</url-pattern>
 
Alex Ryan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much Charles.
You were absolutely right.
This solved my problem.
VERY much appreciated.
Good karma to you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic