• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

jwebplus doubt?

 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone explain how come option 'e' becomes wrong here?

Cheers!
Leena
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic