• Post Reply Bookmark Topic Watch Topic
  • New Topic

A Question in void Jspdestroy method

 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a client request the jsp page from the server and he closes the browser.In the jsp page destroy method is called.My question is
how does the server knows the client is closing the browser ?? to invoke
the destroy method of jsp ???
Regards,
Sangeetha
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The server never knows that the browser is being closed or switching to another site. The destroy method (servlets) or jspDestroy method (JSP) is only used when the server is removing the servlet/JSP from service and has NOTHING to do with handling a user request/response cycle.
All of this information is available in the servlet JavaDocs - anybody working with JSP should have these on hand. If you are using Tomcat, they were installed in your ../webapps/tomcat-docs/ directory.
Bill
 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"when the server is removing the servlet/JSP from service and has NOTHING to do with handling a user request/response cycle "
Heyyy cany u tell me when the server decides this situation ???.
Does it maitains any states for this ???
No I don't use tomcat .Iam using weblogic server 5.1

Regards,
Sangeetha
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, each author of a server is free to come up with his/her own method for deciding when to discard a servlet instance. For example, it might happen if the server is getting low on memory - it could discard the least recently used servlet. Of course that would require keeping some additional state information.
Tomcat and presumably other servers provide a management function that lets you request that the servlet be removed.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!