|
Hi,
My senior programmer put me 2 questions
w.r.t. threads, servlets and the servlet engine.
1. Suppose unloading or terminating the servlet by calling its
destroy() method is going to
cause a threading issue. We have to wait
until all the threads currently executing in the
service() methods of the servlet to finish
before destroying and releasing resources. Lets
assume that we alsol keep a count of the
number of threads in the service() methods and
use a flag as given in the online Java
Tutorial.
Question: Even though we do this, how can
we prevent new requests from entering the
service() methods even after the destroy() method is called. This could mean
that
the servlet is never unloaded???
2. What sort of new security issues will servlets face when
accessing resources on the intranet
for e.g. a file with access rights
etc.??
My answer for both were:
1. The webserver can't prevent requests from being sent to the
servlet engine Connection Proxy
service in the case of JRun. So the Servlet
Engine would prevent further requests from being
executed inside the service() method for a
servlet whose destroy() method has been called.
2. It has to use something like NT authentication although I
do not know how the Servlet is directly
going to access the resource by providing
the login & password.
I do not think the above two answers are
correct. So I would be most grateful if there is somebody
or anybody who can help me
with some answers to the questions above.
thanks so much,
Jeena Jones.
(Junior Software Engineer)
-----------------------------------------------------------------------
Computing life: the S.S.E says everything can be done to
the
customer and the J.S.E has to figure out how to do
them.......
|
- Re: Very Difficult Servlet Question (Answer not ... Mageshkumar Maruthapillai
- Re: Very Difficult Servlet Question (Answer... Subrahmanyam A.V.B.
- Re: Very Difficult Servlet Question (Answer... Ted Stockwell
- Re: Very Difficult Servlet Question (An... Charles Forsythe
