본문 바로가기

웹개발 셋팅

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_2_5.xsd" id="WebApp_ID" version="2.5">

  <display-name>spring3</display-name>

  <welcome-file-list>

    <welcome-file>index.html</welcome-file>

    <welcome-file>index.htm</welcome-file>

    <welcome-file>index.jsp</welcome-file>

    <welcome-file>default.html</welcome-file>

    <welcome-file>default.htm</welcome-file>

    <welcome-file>default.jsp</welcome-file>

  </welcome-file-list>

  

    <!-- 스프링 환경 설정 시작 -->


    <!-- ContextLoaderListener : 서로 다른 DispatcherServlet이 공통으로 사용될 빈 설정  -->

    <!-- context-param 태그로 설정파일을 지정하지 않으면 applicationContext.xml이 설정 파일이 된다.  -->

        <context-param>

   <param-name>contextConfigLocation</param-name>

        <param-value>

            /WEB-INF/applicationContext.xml

            /WEB-INF/security-context.xml

        </param-value>

</context-param>


<listener>

<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

</listener>


    <!-- 스프링 컨트롤러 -->

    <!-- init-param으로 설정하지 않으면 dispatcher-servlet.xml이 설정 파일이 된다.-->

<servlet>

<servlet-name>dispatcher</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

        <!-- 

        <init-param>

<param-name>contextConfigLocation</param-name>

<param-value>

/WEB-INF/dispatcher-servlet.xml,

/WEB-INF/front.xml

</param-value>

        </init-param>

        --> 

<load-on-startup>1</load-on-startup>

</servlet>


<servlet-mapping>

<servlet-name>dispatcher</servlet-name>

<url-pattern>*.action</url-pattern> <!-- url주소 뒤에 붙는 확장자 맵핑을 설정 -->

</servlet-mapping>


      <!-- 인코딩 필터 -->

<filter>

<filter-name>encodingFilter</filter-name>

<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>

<init-param>

<param-name>encoding</param-name>

<param-value>UTF-8</param-value>

</init-param>

</filter>

<filter-mapping>

<filter-name>encodingFilter</filter-name>

<url-pattern>/*</url-pattern>

</filter-mapping>


<!-- 스프링 시큐리티 -->

<filter>

        <filter-name>springSecurityFilterChain</filter-name>

        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>

    </filter>

    <filter-mapping>

        <filter-name>springSecurityFilterChain</filter-name>

        <url-pattern>/*</url-pattern>

    </filter-mapping>

  

</web-app>

'웹개발 셋팅' 카테고리의 다른 글

security-context.xml  (0) 2013.11.27
root-context.xml (applicationContext.xml)  (0) 2013.11.27
VPN이란  (0) 2013.11.27
이클립스에서 DB2 log4jdbc 사용하기  (0) 2013.11.25
log4jdbc  (0) 2013.11.24