web.xml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. <!-- <error-page>
  46. <error-code>404</error-code>
  47. <location>/WEB-INF/jsp/404.jsp</location>
  48. </error-page>
  49. <error-page>
  50. <error-code>500</error-code>
  51. <location>/WEB-INF/jsp/500.jsp</location>
  52. </error-page>
  53. <error-page>
  54. <error-code>400</error-code>
  55. <location>/WEB-INF/jsp/400.jsp</location>
  56. </error-page>-->
  57. </web-app>