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