반응형

1. Web 추가

WEB-INF 폴더 아래에 web.xml을 둔다

 

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
 id="WebApp_ID" version="3.0">
 <display-name>Welcome to SAP ERP WEB PAGE</display-name>
 <description>
     SAP ERP WEB PAGE
   </description>

 <error-page>
  <error-code>401</error-code>
  <location>/WEB-INF/error/error401page.jsp</location>
 </error-page>

 <error-page>
  <error-code>404</error-code>
  <location>/WEB-INF/error/error404page.jsp</location>
 </error-page>
 
 <error-page>
  <error-code>500</error-code>
  <location>/WEB-INF/error/error500page.jsp</location>
 </error-page>
 
 <error-page>
  <exception-type>java.lang.NullPionterException</exception-type>
  <location>/WEB-INF/error/errorNull.jsp</location>
 </error-page>
 
 <error-page>
  <exception-type>java.lang.Throwable</exception-type>
  <location>/WEB-INF/error/errorThrowable.jsp</location>
 </error-page>
 
 <error-page>
  <exception-type>java.lang.Exception</exception-type>
  <location>/WEB-INF/error/errorException.jsp</location>
 </error-page>
 

</web-app>

 

2. 페이지에 추가

 <%@ page errorPage="error.jsp">

 

 error.jsp

 

 <%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%@ page isErrorPage="true" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
 Error Type : <%=exception.getClass().getName() %>
 Error Message : <%=exception.getMessage() %>
 <br>
 <br> Please Try Again<br>
 <input type="button" value="Back" onclick="history.back();" />
</body>
</html>

 

 

3. 익스플로러 오류페이지 안나오는 것.

 익스플로러9 이상은 에러 페이지를 자동으로 잡아서 지가 뿌린다. 망할

 이거 땜시 2시간 고생;;;

 설정 > 인터넷 옵션 > 고급 > HTTP 오류 메시지 표시  체크 해제

반응형

'프론트엔드 > Server Part' 카테고리의 다른 글

Java Mssql Connection Example  (0) 2014.08.20
세션 관리  (0) 2014.04.05
페이지 추가하는 법  (0) 2013.05.23
style 태그 사용법  (0) 2013.05.23
useBean과 톰캣 Tomcat 폴더 지정  (0) 2013.05.12

WRITTEN BY
데르벨준

,