티스토리 뷰
exceptionnoproductid.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<jsp:include page="menu.jsp" />
<div class="jumbotron">
<div class="container">
<h2 class="alert alert-danger">해당 상품이 존재하지 않습니다.</h2>
</div>
</div>
<div class="container">
<p><%=request.getRequestURL()%>?<%=request.getQueryString()%>
<p> <a href="products.jsp" class="btn btn-secondary">상품 목록 »</a>
</div>
</body>
</html>
product.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import = "dto.product" %>
<%@ page import="dao.productrepository" %>
<%@ page errorPage="exceptionnoproductid.jsp" %>
<jsp:useBean id = "productDAO" class="dao.productrepository" scope="session" />
<%@ page errorPage="exceptionnoproductid.jsp" %> 구문이 추가된다.
web.xml
</login-config>
<error-page>
<error-code>404</error-code>
<location>/exceptionnopage.jsp</location>
</error-page>
</web-app>
구문 추가한다.
exceptionnopage.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<jsp:include page="menu.jsp" />
<div class="jumbotron">
<div class="container">
<h2 class="alert alert-danger">요청하신 페이지를 찾을 수 없습니다.</h2>
</div>
</div>
<div class="container">
<p><%=request.getRequestURL()%></p>
<p><a href="products.jsp" class="btn btn-secondary">상품 목록 »</a>
</div>
</body>
</html>
'코딩 > JSP' 카테고리의 다른 글
[10주 3일차] 예외 처리 (0) | 2023.12.13 |
---|---|
[10주 3일차] 시큐리티 (2) (0) | 2023.12.13 |
웹쇼핑몰:상품 등록 페이지의 보안 처리하기 (0) | 2023.12.13 |
[10주 2일차] 시큐리티 (1) (1) | 2023.12.12 |
[10주 2일차] 다국어 처리 (2) (0) | 2023.12.12 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday