• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

servlet unloading

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are the various ways to unload a servlet?
more simply, when a servlet is called, it is loaded by the web server, the required method is called and after that the servlet is unloaded.
So when can I be sure that my servlet has been unloaded??
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi rajeev!
when the servlet is changed, old servlet will be unload.The servlet will be unloaded when the destroy method is called.you can unload the servlet by explicitely calling the destroy method.
 
rajeev holkar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The things are getting clearer ... thanks ...
But this leads to another one ...
i have coded a servlet and the servlet takes a value for a X variable from a file(txt or any other) in the INIT method and writes back the present(modified) value of the X variable to the same file in the DESTROY function.
Now after updating the value of X, i closed the browser.
1. In this case, is the DESTROY function called?
2. If not, then who should be responsible for updating the file.
3. what could be the exact sequence??
Thanks in advance ...
rajeev
 
Bartender
Posts: 612
7
Mac OS X Python
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a question about the Distroy.
Will the distroy cause the servlet to be unload immeaditatly or is it like garbage collection?
Thanks
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Closing the browser has nothing to do with the servlet. The servlet might not be unloaded for days or weeks (if you are running a Unix server). The servlet will only get unloaded when the server decides that it needs to unload the servlet usually for memory purposes.
 
rajeev holkar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmmmmmmmmmm .... this is something ....
Thanks Paul.
 
Everybody's invited. Except this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic