IT_Note


web.xml


<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xmlns="http://java.sun.com/xml/ns/javaee"

         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>board1</display-name>

    

   <!--

- Location of the XML file that defines the root application context.

- Applied by ContextLoaderListener.

-->

<!-- 공통으로 사용될 빈 환경설정 파일 -->

    <context-param>

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

        <param-value>classpath:spring/application-config.xml</param-value>

    </context-param>


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

    <listener>

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

    </listener>

    

    

    <!--

- Servlet that dispatches request to registered handlers (Controller implementations).

DispatcherSErvlet등록 및 스프링 컨트롤러의 환결설정 파일

-->

    <servlet>

        <servlet-name>dispatcherServlet</servlet-name>

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

        <init-param>

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

            <param-value>/WEB-INF/mvc-config.xml</param-value>

        </init-param>

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

    </servlet>


    <servlet-mapping>

        <servlet-name>dispatcherServlet</servlet-name>

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

    </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>

</web-app>