Julien Gilli wrote:
>
> "System.exit(0);" the whole Servlet engine is killed
> how could i avoid that behavior ?
>

 More background as to why you want to do this would
help. One perfectly legitimate reason to ask this
question is if you intend to deploy a servlet container
for public use. What if one of your customers writes
an evil servlet?

 General answer: you're hosed. There are so many ways
to write evil servlets[1] that's it's currently impossible
to defend against all of them.

 Specific answer: check out

   java.lang.SecurityManager.checkExit(int)

 For tomcat, newer versions have a -security flag that
turns on a security manager that uses a file in the
conf directory to tell the container what to allow.
I've never used it, I don't know if it works, and I
don't know if tomcat 3.* has the same thing, but some
web searching and FAQ-reading and tomcat-users-email'ing[2]
should get you an answer now that you know it's possible.
Other servlet containers may differ.


[1] Evil on purpose is hard, but what about accidently
evil servlets? Coding mistakes? Nope, still hosed. A
regular old JVM isn't a full-blown operating sytem, so
it doesn't have the sort of bulletproof resource
management capabilities that an o/s does. Evil threads
are especially difficult...

[2] Go to the tomcat home page. (If you can't find the
homepage, give up now) Check out the documentation. If
you have further questions, check out the TOMCAT-USERS
mailing list, tomcat developers hang out there, so it's
a better place to ask tomcat-specific questions.


--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to