top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Can I use System.exit() in servlets?

+2 votes
288 views
Can I use System.exit() in servlets?
posted Oct 22, 2015 by Shyam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

The JVM running the servlet container would terminate, so, yes. Well, System.exit() will terminate the current running JVM. So it is likely that the code written in servlet containers' addShutdownHook will be triggered. No you cannot because it will throw a security exception.

answer Oct 23, 2015 by Karthick.c
...