User thread spawning in Jetty
I have a web application running over Jetty, and I need to spawn a thread for idle connection handling. This thread is being started in the spring开发者_开发知识库 context.
I know it's not a good practice to spawn threads in a container, but couldn't find a better way to do this. Any ideas?
You can have the container set up a timer or thread pool for you. See the docs.
The traditional way to handle such resources is in a servlet context listener. Check the Servlet API.
精彩评论