yoursyun

Web.xml 본문

environment/java

Web.xml

yoursyun 2009. 1. 9. 09:13
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <web-app xmlns="http://java.sun.com/xml/ns/javaee"  
  3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  4.     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"  
  5.     version="2.5">  
  6.   
  7.     <!-- JDBC 연결을 위한 정보 -->  
  8.     <resource-ref>  
  9.         <description>OracleDatasource</description>  
  10.         <res-ref-name>jdbc/myoracle</res-ref-name>  
  11.         <res-type>javax.sql.DataSource</res-type>  
  12.         <res-auth>Container</res-auth>  
  13.     </resource-ref>  
  14.   
  15.     <context-param>  
  16.         <param-name>ds</param-name>  
  17.         <param-value>jdbc/myoracle</param-vlaue>  
  18.     </context-param>  
  19.   
  20.     <!-- Filter 설정 (Encoding Filter) -->  
  21.     <filter>  
  22.         <filter-name>Encoding Filter</filter-name>  
  23.         <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>  
  24.         <init-param>  
  25.             <param-name>encoding</param-name>  
  26.             <param-value>UTF-8</param-value>  
  27.         </init-param>  
  28.     </filter>  
  29.   
  30.     <filter-mapping>  
  31.         <filter-name>Encoding Filter</filter-name>  
  32.         <servlet-name>action</servlet-name>  
  33.     </filter-mapping>  
  34.   
  35.     <!-- servlet 설정 -->  
  36.     <servlet>  
  37.         <servlet-name>action</servlet-name>  
  38.         <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>  
  39.         <init-param>  
  40.             <param-name>config</param-name>  
  41.             <param-value>/WEB-INF/struts-config.xml</param-value>  
  42.         </init-param>  
  43.         <init-param>  
  44.             <param-name>debug</param-name>  
  45.             <param-value>3</param-value>  
  46.         </init-param>  
  47.         <init-param>  
  48.             <param-name>detail</param-name>  
  49.             <param-value>3</param-value>  
  50.         </init-param>  
  51.         <load-on-startup>0</load-on-startup>  
  52.     </servlet>  
  53.   
  54.     <servlet-mapping>  
  55.         <servlet-name>action</servlet-name>  
  56.         <url-pattern>*.do</url-pattern>  
  57.     </servlet-mapping>  
  58.   
  59.     <!-- 세션 기간 설정 -->  
  60.     <session-config>  
  61.         <session-timeout>30</session-timeout>  
  62.     </session-config>  
  63.   
  64.     <!-- 시작페이지 설정 -->  
  65.     <welcome-file-list>  
  66.         <welcome-file>index.jsp</welcome-file>  
  67.     </welcome-file-list>  
  68.   
  69.     <!-- 존재하지 않는 페이지, 404에러시 처리 페이지 설정 -->  
  70.     <error-page>  
  71.         <error-code>404</error-code>  
  72.         <location>/404.jsp</location>  
  73.     </error-page>  
  74.   
  75.     <!-- 500에러시 처리 페이지 설정 -->  
  76.     <error-page>  
  77.         <error-code>500</error-code>  
  78.         <location>/500.jsp</location>  
  79.     </error-page>  
  80.   
  81.     <!-- NullpointException발생시 처리 페이지 설정 -->  
  82.     <error-page>  
  83.         <exception-type>java.lang.NullPointerException</exception-type>  
  84.         <location>/null.jsp</location>  
  85.     </error-page>  
  86.   
  87.     <!-- 태그 라이브러리 설정 (JSTL"coreTag"을(를) 사용)-->  
  88.     <jsp-config>  
  89.         <taglib>  
  90.             <taglib-url>http://java.sun.com/jsp/jstl/core</taglib-url>  
  91.             <taglib-location>/WEB-INF/tld/c.tld</taglib-location>  
  92.         </taglib>  
  93.     </jsp-config>  
  94. </web-app>  

반응형