When browsing a webpage, we often enter a webpage that may not exist on the server, but we do not want to use the error handling page provided by the server to define a 404 error handling page for ourselves, this is also more lively and interesting .... the following is the defined method. first, write your own error page,
First, we define an error handling JSP page error.jsp?error.html page
1:<HTML>
2:<Head>
3:<Title> Error 404 page </title>
4:</Head>
5:<Body>
6:
"center" style =
" margin-top: 200px; " congratulations! You came to the 404 page... the current file does not exist... hahaha
7:</Body>
8:</Html>
You can write some more interesting error pages by yourself ....
Configure the following in the web. XML page:Code:
1:<Error-page>
2:<Error-code> 404 </error-code>
3:<Location>/error. jsp </location>
4:</Error-page>
Of course, we can also use the same method to define other errors, 400,500 errors, and so on.