1 403, 404, 500 introduction
HTTP 403-No access
HTTP 404-file cannot be found
HTTP 500-Internal server error
2 403, 404, 500 configured in the project
(1) web.xml
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/500.jsp</location>
</error-page>
<error-page>
<error-code>403</error-code>
<location>/403.jsp</location>
</error-page>
(2) JSP page
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "iserrorpage=" true "pageencoding=" UTF-8 "%>
<% Response.setstatus (HTTPSERVLETRESPONSE.SC_OK); %>
<title> Friendly Tips 500</title>
<body>
<font style= "FONT-SIZE:18PX; Font-weight:bold; Color: #333; > The page you visited does not exist. </font>
</body>
Note: The Scarlet Letter part is necessary.