본문 바로가기
[LANG]/- HTML&CSS

[JSP] 에러페이지/에러페이징 (Feat XML)

by Hapco 2022. 6. 2.
728x90
반응형

XML (extends markup language)

-임의로 태그를 만들수 있는 데이터 저장 방식

-해석하는 주체에 따라 필요한 태그가 정해져 잇다

-html과 동일한 문법 체계를 가짐

-xmlns속성을 통하여 필요한 태그를 알려줄수 잇다.

-xmlns는 XML nameSapce의 줄임말로 xml에서 사용할 문법 체계가 저장된위치

-xmlns: xsi는 Xml schema Instance의 줄임말로 xml에 대한 품질 보증서위치

 

<web-app version="4.0" 
 xmlns="http://xmlns.jcp.org/xml/ns/javaee" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee                      
 http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
 <!-- 대문 페이지 설정 재정의  -->
 <welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
 </welcome-file-list>
 <!-- 세션 만료설정 재정의 -->
 <session-config>
  <session-timeout>360</session-timeout>
 </session-config>
 <!-- 에러 페이지 설정  -->
  <error-page>
  <error-code>401</error-code>
  <location>/member/login.jsp</location>
  </error-page>
 <error-page>
  <error-code>404</error-code>
  <location>/error/404.jsp</location>
 </error-page>
 
  <error-page>
  <error-code>405</error-code>
  <location>/error/404.jsp</location>
 </error-page>
 <error-page>
  <error-code>500</error-code>
  <location>/error/500.jsp</location>
 </error-page>
 
 </web-app>

<error-page> <에러페이징

<error-code>405</error-code> <에러코드

<location>/error/404.jsp</location> <에러코드나오면 보낼 위치

</error-page>

댓글