This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How many instances of a Servlet filter will there be within the container

 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Supposed I have a LoginFilter, defined the usual way:

public class LoginFilter implements Filter, Servlet {


Its executed for every URL that goes through the container (tomcat, glassfish, etc.)

How many "LoginFilter" objects are in the VM? Just one? one per thread? perhaps a pool is kept by the container and managed by it?

Related: does the LoginFilter have to be thread safe?
 
ntumba lobo
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the default is one instance per jvm
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!