javaweb's jsp----------02 configuration error page

1. Write jsp page on webapp


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<h1>这是404页面</h1>

</body>
</html>

2. Configure on web.xml

<error-page>
    <error-code>404</error-code>
    <location>/error/404.jsp</location>
  </error-page>

carry out

Guess you like

Origin blog.csdn.net/qq_42794826/article/details/113835672