web.xml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  3. <display-name>Spring Security NTLM</display-name>
  4. <!-- 1. Setup two parameters: -->
  5. <!-- a) Spring Security's configuration file -->
  6. <!-- b) Logging configuration file -->
  7. <context-param>
  8. <param-name>contextConfigLocation</param-name>
  9. <param-value>/WEB-INF/applicationContext.xml</param-value>
  10. </context-param>
  11. <context-param>
  12. <param-name>log4jConfigLocation</param-name>
  13. <param-value>/WEB-INF/log4j.properties</param-value>
  14. </context-param>
  15. <!-- 2. Setup the Spring Security Filter Chain Proxy -->
  16. <filter>
  17. <filter-name>Spring Security Filter Chain Proxy</filter-name>
  18. <filter-class>org.springframework.security.util.FilterToBeanProxy</filter-class>
  19. <init-param>
  20. <param-name>targetClass</param-name>
  21. <param-value>org.springframework.security.util.FilterChainProxy</param-value>
  22. </init-param>
  23. </filter>
  24. <filter-mapping>
  25. <filter-name>Spring Security Filter Chain Proxy</filter-name>
  26. <url-pattern>/**</url-pattern>
  27. </filter-mapping>
  28. <!-- 3. Setup three listeners -->
  29. <!-- a) Setup a listener to connect spring with the web context -->
  30. <listener>
  31. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  32. </listener>
  33. <!-- b) Setup a listener to connect spring with log4J -->
  34. <listener>
  35. <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  36. </listener>
  37. <!-- c) Setup Spring Security to subscribe to http session events in the web context -->
  38. <listener>
  39. <listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>
  40. </listener>
  41. <welcome-file-list>
  42. <welcome-file>index.html</welcome-file>
  43. <welcome-file>index.htm</welcome-file>
  44. <welcome-file>index.jsp</welcome-file>
  45. <welcome-file>default.html</welcome-file>
  46. <welcome-file>default.htm</welcome-file>
  47. <welcome-file>default.jsp</welcome-file>
  48. </welcome-file-list>
  49. </web-app>