관리 메뉴

취미개발 블로그와 마음수양

web.xml 스프링3입문 본문

FrameWork_ETC/Spring

web.xml 스프링3입문

아라한사 2014. 8. 5. 18:34

 <!-- 01. Config about Put which DI Container in Web Container -->

  <!--  I think this is for applicationContext.xml -->

  <context-param>

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

  <param-value>

  classpath:/META-INF/spring/beans-biz.xml

  </param-value>

  </context-param>

  

<!-- 02. Write DI container in  Web Container -->

<listener>

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

</listener>

<!-- 03.  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>classpath:/META-INF/spring/beans-webmvc.xml</param-value>

</init-param>

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

</servlet>


<!-- 04. DispatcherServlet Path Config  -->

<servlet-mapping>

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

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

</servlet-mapping>

<!-- 05. Just Reading -->

<context-param>

<param-name>defaultHtmlEscape</param-name>

<param-value>true</param-value>

</context-param>

<!-- 06. Encoding Config -->

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