>>> Prasad Akella <[EMAIL PROTECTED]> 9/18/99 12:22:25 AM >>>
>I know that Servlets are inherently multithreaded...meaning once a
Servlet
>is loaded, it can serve multiple requests by spawing multiple
threads.
Maybe I'm being picky but this is not so.
The ServletEngine creates the multiple threads... the servlet is just
called within the threads by the ServletEngine.
The Servlet itself has no knowledge of the threading environment in
which it is run.
>Is there a limit on the number of threads a servlet can spawn ? Or
is it a
>configurable param of the WebServer ?
Since the servlet doesn't do this there is no way for it to control
the limit.
The control of threads is performed by the ServletEngine and many
ServletEngines have methods for controlling the number of threads.
>Is it more efficient to have multiple servlets, each handling
different type
>of requests OR since anyway the Servlet spawns multiple threads for
>concurrent requests, can I have just one Servlet which invokes
different
>methods internally depending on the Action param or something?
It depends. If you use the one servlet apporach you will, eventually,
end up with messy code.
My advice is to have a one-to-one mapping between a servlet and a
resource path.
So, you might want to serve requests from the /service resource path,
well just write a servlet that services that path.
If you want a servlet that services .jsp then just use a JSP servlet
on that path.
Hope this helps.
Nic
___________________________________________________________________________
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