By not calling System.exit().
Instead, call the appropriate API for shutting down web-apps for your container, which is container-specific. System.exit()
isn't it. See the Javadoc. It's for shutting down entire JVMs, such as servlet containers.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…