pom.xml
x<properties>
<java-version>11</java-version>
</properties>
<configuration>
<source>1.6</source>
<target>1.6</target>
<configuration>
pom.xml
xxxxxxxxxx
<org.springframework-version>5.3.6</org.springframework-version>
xxxxxxxxxx
<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>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
1. 스프링 MVC는 MVC 패턴 개발을 도와주기 위해 있는 것 2. XML관련 설정과 @어노테이션의 의미를 파악하는게 중요
xxxxxxxxxx
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
xxxxxxxxxx
<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/appServlet/servlet-context.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<annotation-driven />
어노테이션 설정 방식을 사용을 위해 설정
<resources mapping="/resources/**" location="/resources/" />
image, css, js 등의 리소스 위치 등록
xxxxxxxxxx
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="패키지명" />