500 error resolution for built-in exception object in JSP _jsp programming

Source: Internet
Author: User
Tags gettext

The example in this article describes a workaround for 500 errors when building exception objects in a JSP. Share to everyone for your reference, specific as follows:

Try using the built-in exception object of the JSP to write the following three files. The idea is very simple, the file index if the submission string is empty, then get thrown exception, referred to error.jsp processing. But the actual does not run normally, will appear IE 500 error page. The environment is Tomcat 5.5,ie6.0.

In Sun's forum someone posted the reason, ie is a certain setting. Tomcat5.0 the later version of the error page will return error code 500 when processing. IE after the Code 500 will check the length of the page, when the length of less than a certain value, it will use its default 500 error pages to replace the error page set. It's called "user-friendliness" (it's been a long time and I'm not friendly at all).

Then the workaround could be to modify IE

Settings: Remove IE "tools--internet option-advanced-Show friendly HTTP error messages" option, or increase the length of your error page.

index.jsp


<% @page language= "java" errorpage= "error.jsp"%>
 
 

error.jsp

<% @page language= "java" iserrorpage= "true"%>
 
 

Personal Summary

The so-called increase in length, that is, in the error.jsp file, more copies of some text content, you can run the normal.

I hope this article will help you with JSP program design.

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.