Quick Start

Make

  1. STS 의 [File]-[New]-[Spring Template Project] 를 실행하고 [Spring MVC Project] 를 선택한다.

  2. Project Name 과 Top-level Package 를 설정한다.

  3. Project 생성

Config

  1. Edit pom.xml. <dependencies> 를 다음과 같이 변경한다.
    	<dependencies>
    		<!-- 
    		####################################
    		# springfield
    		####################################
    		 -->
    		<dependency>
    	        <groupId>com.u2ware</groupId>
    	        <artifactId>springfield</artifactId>
    	        <version>1.3.9</version>
    		</dependency>
    					
    		<!-- Servlet -->
    		. 
    		.
    	
    		<!-- Test -->
    		. 
    		.
    	</dependencies>
    				
  2. Edit Web.xml.

    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>
    				

Run

  1. Project 를 WAS 에 로드한다.

  2. WAS 를 시작하고. 웹 브라우저에서 페이지를 요청한다.