web.xml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns="http://java.sun.com/xml/ns/javaee"
  4. xsi:schemaLocation="
  5. http://java.sun.com/xml/ns/javaee
  6. http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
  7. version="3.0">
  8. <display-name>Spring4.x + SpringMVC4.x + Mybatis3.2.8</display-name>
  9. <context-param>
  10. <param-name>contextConfigLocation</param-name>
  11. <param-value>classpath:applicationContext.xml</param-value>
  12. </context-param>
  13. <listener>
  14. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  15. </listener>
  16. <servlet>
  17. <servlet-name>mybatis</servlet-name>
  18. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  19. <init-param>
  20. <param-name>contextConfigLocation</param-name>
  21. <param-value>classpath:mybatis-servlet.xml</param-value>
  22. </init-param>
  23. <load-on-startup>1</load-on-startup>
  24. </servlet>
  25. <servlet-mapping>
  26. <servlet-name>mybatis</servlet-name>
  27. <url-pattern>/</url-pattern>
  28. </servlet-mapping>
  29. <filter>
  30. <filter-name>SpringEncodingFilter</filter-name>
  31. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  32. <init-param>
  33. <param-name>encoding</param-name>
  34. <param-value>UTF-8</param-value>
  35. </init-param>
  36. <init-param>
  37. <param-name>forceEncoding</param-name>
  38. <param-value>true</param-value>
  39. </init-param>
  40. </filter>
  41. <filter-mapping>
  42. <filter-name>SpringEncodingFilter</filter-name>
  43. <url-pattern>/*</url-pattern>
  44. </filter-mapping>
  45. </web-app>