cmstop-error.css
html,body,head,div,p,a { margin: 0; padding: 0; } .body-bg { background-color: #dff1f4; } .main { width: 700px; overflow: hidden; height: 542px; margin: 20px auto; background: url(../images/error-bg.png) no-repeat 0 0; } .title { font-size: 14px; font-weight: bold; margin: 254px 0 0 218px; color: #d3d3d3; } .btn { display: block; background: url(../images/error-btn.png) no-repeat 0 0; width: 145px; height: 45px; font-size: 14px; margin: 95px 0 0 270px; line-height: 43px; color: #fff; font-weight: bold; text-align: center; text-decoration: none; }
error404.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>error404</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <link rel="stylesheet" type="text/css" href="css/cmstop-error.css" media="all"> </head> <body> <body class="body-bg"> <div class="main"> <p class="title">非常抱歉,您要查看的页面没有办法找到</p> <a href="index.jsp" class="btn">返回网站首页</a> </div> </body> </html>
web.xml
<error-code>404</error-code> <location>/error404.jsp</location> </error-page>
时间: 2024-10-30 22:02:11