Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jwebplus doubt?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that the Servlet Container has just called the destroy() method of a servlet instance, which of the following statements are correct?

Select 2 correct options
a Any resources that this servlet might hold have been released.

b The servlet container time out has exceeded for this servlet instance.

c The init() method has been called on this instance.

d None of the requests can EVER be serviced by this instance.

e All threads created by this servlet are done.

it seems answer is c & d. how come c is answer.

yamini
 
Osama Hasan
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I think c is correct because it seems obvious that the destroy method is called on an instance only after it is created and so the init method must have been called on this instance.
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone explain how come option 'e' becomes wrong here?

Cheers!
Leena
 
Jeff Wachhorst
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Option E is incorrect as there is no monitoring of threads that a servlet itself creates. destroy() is "only called once all threads within the servlet's service method have exited or after a timeout period has passed."
I believe this statement refers to threads that the container has created to execute a servlet rather than threads that the developer created IN that servlet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic