It is not actually a meaningful thing to ask for. Threads don't belong to a servlet. Rather, they belong to the web container and are used to run requests ... which at certain points involves running servlet methods. A servlet method can of course find out what the current thread is ... but then so can any method. It is also possible that the web container might use thread groups in a way that allows you to determine that certain threads are used for certain things. But that would be highly implementation specific. If that's not what you mean, then please refine your question.
Read full article from java - How can I get the thread id of the threads of the servlet? - Stack Overflow
No comments:
Post a Comment