2013. 2. 1. 02:39 ::Tip
JSP 에러페이지 처리방법
404에러나 500에러시 페이지 처리법입니다.
책이나 검색하시면 나와요!
web.xml
<error-page>
<error-code>404</error-code>
<location>/error/404code.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error/500code.jsp</location>
</error-page>
WEB-INF/web.xml에 소스 추가
404code.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%
response.setStatus(HttpServletResponse.SC_OK);
%>
<html>
<head>
<title>404에러페이지</title>
</head>
<body>
요청하신 페이지는 존재하지 않습니다.
</body>
</html>
404에러는 Not Found, 문서를 찾을 수 없을때 발생하는 에러이므로
URL을 다시 잘 보고 주소를 올바르게 입력하면 해결
500code.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%
response.setStatus(HttpServletResponse.SC_OK);
%>
<html>
<head>
<title>500에러페이지</title>
</head>
<body>
서비스 사용에 불편을 끼쳐드려서 대단히 죄송합니다.<br>
빠른 시간내에 문제를 처리하겠습니다.
</body>
</html>
500에러는 Internal Server Error 즉 서버 내부 오류이며,
웹서버가 요청사항을 수행할 수 없을때 발생됨
<500에러가 발생 창>
Copyright © ☆ All Rights Reserved. | Designed by CMSFactory.NET
Recent Comments