JSP shows exceptions in Java background

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.