Marc Krisjanous wrote:

> Hi all,
>
> I was wondering if there was some way of getting the thread name of a
> request that comes into a servlet?
>

You can call Thread.currentThread().getName(), but it will not be very useful to
you.  Most servlet containers reuse request processing threads for subsequent
requests, so the same thread name will show up over and over again.  In between
requests, the threads are waiting to be reused in some sort of thread pool
inside the container.

>
> I would like to identify an individual request (thread) and I do not want to
> use the session id since the request may come from a child web browser
> window (which would have the same session id).
>

That is true, but the next request from that same window will come in on some
other (essentially randomly assigned) thread.  So it doesn't help you beyond the
duration of the current request.

>
> Best Regards
>
> Marc
>

Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to