4. web.xml 설정
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>
'WEB > 게시판구현_springMvc2+mybatis' 카테고리의 다른 글
6. 마이바티스 설정 mybatis-config, mybatis-context, mapper (0) | 2017.04.12 |
---|---|
5. mvc-config.xml ,application-config 설정 (0) | 2017.04.12 |
3. 메이븐, pom.xml 설정 (0) | 2017.04.12 |
2. URL, 파라미터 설정 (0) | 2017.04.12 |
1.STS - 스프링 mvc2 게시판 만들기 전체적인 개요 (0) | 2017.04.12 |