struts2+spring Configuring the 404 and 500 error pages

Source: Internet
Author: User

Recently encountered a problem, in the browser casually enter the address should jump to 404 or 500 interface, engaged in a half-day only to find the problem of their own configuration.

A brief introduction to the 404 and 500 and other error interfaces should be configured in Web. Xml as follows:

<error-page>

<error-code>500</error-code>

<location>/common/error.jsp</location>

</error-page>

<error-page>

<error-code>404</error-code>

<location>/common/404.jsp</location>

</error-page>

<error-page>

<error-code>403</error-code>

<location>/common/403.jsp</location>

</error-page>

The above configuration to the Web. XML should be no problem, but STRUTS2 also has a development mode is open by default, we need to add a struts.properties file in the Config directory: The file contains only one row struts.devmode= False to close this development mode, all errors will only want to 500 pages.

struts2+spring Configuring the 404 and 500 error pages

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.