Assuming that the
Servlet Container has just called the destroy() method of a servlet instance,
which of the following statements are correct?
select 2 options
1. Any resources that this servlet might have held have been released
2. The servlet container time out has exceeded for this servlet instance.
3. The init() method has been called on this instance.
4. None of the requests can EVER be serviced by this instance.
5. All threads created by this servlet have ended.
answer is 3,4
why not 2,3,4,5?
and the explanation for this question is given below
the threads created by the servlet. The servlet container cannot kill any
threads created by a Servlet developer and has no idea whether they are finished or not.
Generally, servlets are not supposted to create new threads but a developer can do so if
required.
Although option 2 is a possibility, it is not the only reason for calling destroy() on a servlet
instance.
question from enthuware
is it not the job of the container to create
thread for each request? and they should when the thread has finished its job right?
correct me if i am wrong
Thanks
Srividhya