javaweb之jsp----------02配置错误页面

1.在webapp上编写jsp页面


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

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

</body>
</html>

2.在web.xml上配置

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

完成

猜你喜欢

转载自blog.csdn.net/qq_42794826/article/details/113835672