<dependencies> <!-- #################################### # springfield #################################### --> <dependency> <groupId>com.u2ware</groupId> <artifactId>springfield</artifactId> <version>1.3.9</version> </dependency> <!-- Servlet --> . . <!-- Test --> . . </dependencies>
root-context 설정. "contextConfigLocation" 파라미터 값을 다음과 같이 변경한다.
<context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:com/u2ware/springfield/sample/root-context.xml </param-value> </context-param>
servlet-context 설정. "contextConfigLocation" 파라미터 값을 다음과 같이 변경한다.
<servlet> <servlet-name>appServlet</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/root-context.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
서블릿 필터를 추가 한다. Spring DispatcherServlet 의 이름은 "appServlet" 이다.
<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> <servlet-name>appServlet</servlet-name> </filter-mapping> <filter> <filter-name>multipartFilter</filter-name> <filter-class> org.springframework.web.multipart.support.MultipartFilter </filter-class> </filter> <filter-mapping> <filter-name>multipartFilter</filter-name> <servlet-name>appServlet</servlet-name> </filter-mapping> <filter> <filter-name>httpMethodFilter</filter-name> <filter-class> org.springframework.web.filter.HiddenHttpMethodFilter </filter-class> </filter> <filter-mapping> <filter-name>httpMethodFilter</filter-name> <servlet-name>appServlet</servlet-name> </filter-mapping>