Preferred way to handle Java exceptions in ServletContextListener

前端 未结 4 1813
借酒劲吻你
借酒劲吻你 2020-12-29 06:18

For servlet lifecycle stuff, what do you guys recommend doing in response to an exception...

For example,

public class Foo implements ServletContextL         


        
4条回答
  •  一生所求
    2020-12-29 06:40

    It is good tone to show some page like "Technical error, sorry" and not to show the stacktrace with the error message. Just log it and forward the user to error page.

提交回复
热议问题