Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to shut down container from within my servlet?

 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, Iknow, seems like a ridiculous question, right? WhenI start Tomcat (5.5.15), and Tomcat starts my servlet, I want to be able to shut down the Tomcat container from code if there is no work to be done (ie: the servlet was not properly configured, or the database doesn't exist, or something).

Is there any way my servlet can shut down it's own container?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you want to do such a thing?
Do you have no other access to the machine that your server is running under?
 
dema rogatkin
Ranch Hand
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try System.exit(..), however security manager can not allow this for a servlet. Most of servlet containers have admin web UI, so your servlet can use it to shutdown servlet container.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic