web.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!DOCTYPE web-app PUBLIC
  2. "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  3. "http://java.sun.com/dtd/web-app_2_3.dtd" >
  4. <web-app>
  5. <display-name>Archetype Created Web Application</display-name>
  6. <filter>
  7. <filter-name>CharacterEncodingFilter</filter-name>
  8. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  9. <init-param>
  10. <param-name>encoding</param-name>
  11. <param-value>UTF-8</param-value>
  12. </init-param>
  13. </filter>
  14. <filter-mapping>
  15. <filter-name>CharacterEncodingFilter</filter-name>
  16. <url-pattern>/*</url-pattern>
  17. </filter-mapping>
  18. <!--配置DispatcherServlet-->
  19. <servlet>
  20. <servlet-name>dispatcherServlet</servlet-name>
  21. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  22. <!--配置DispatcherServlet的初始化参数:配置文件的名称和位置-->
  23. <init-param>
  24. <param-name>contextConfigLocation</param-name>
  25. <param-value>classpath:applicationContexts.xml</param-value>
  26. </init-param>
  27. <!--应用启动时就创建servlet,而不是第一次请求才创建-->
  28. <load-on-startup>1</load-on-startup>
  29. </servlet>
  30. <servlet-mapping>
  31. <servlet-name>dispatcherServlet</servlet-name>
  32. <!--所有请求都由DispatcherServlet处理-->
  33. <url-pattern>/</url-pattern>
  34. </servlet-mapping>
  35. <welcome-file-list>
  36. <welcome-file>index1.jsp</welcome-file>
  37. </welcome-file-list>
  38. <!-- <servlet-mapping>-->
  39. <!-- <servlet-name>default</servlet-name>-->
  40. <!-- <url-pattern>*.jpg</url-pattern>-->
  41. <!-- </servlet-mapping>-->
  42. <!-- <taglib>-->
  43. <!-- <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>-->
  44. <!-- <taglib-location>/WEB-INF/c.tld</taglib-location>-->
  45. <!-- </taglib>-->
  46. </web-app>