Original: JSP displays Java background exceptions
Source code: Http://www.zuidaima.com/share/1564227137932288.htm
Problems encountered during work: the errors captured by Java background are displayed on the JSP. This allows you to see the cause of the error ahead of time and improve productivity later.
For example, the I=0/0;java in a servlet will certainly report an error:/by zero. That is, the divisor cannot be 0.
Sometimes we may not be able to test this problem when we develop it. After the launch, the test came out of the bug. But it's not possible to debug in a formal environment, or even look at log, so we can make the exception appear on the page.
The case code is below and is a simple servlet to do.
It is important to note that this exception is a 500 error and should be configured on the Web. XML error-page.
JSP shows exceptions in Java background