web.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
  3. <!--
  4. - Contacts web application
  5. - $Id$
  6. - File will be copied into WAR's WEB-INF directory if using container adapter
  7. -->
  8. <web-app>
  9. <display-name>Contacts Sample Application</display-name>
  10. <description>
  11. Example of an application secured using Acegi Security System for Spring.
  12. </description>
  13. <filter>
  14. <filter-name>Acegi Security System for Spring Auto Integration Filter</filter-name>
  15. <filter-class>net.sf.acegisecurity.ui.AutoIntegrationFilter</filter-class>
  16. </filter>
  17. <filter-mapping>
  18. <filter-name>Acegi Security System for Spring Auto Integration Filter</filter-name>
  19. <url-pattern>/*</url-pattern>
  20. </filter-mapping>
  21. <!--
  22. - Servlet that dispatches request to registered handlers (Controller implementations).
  23. - Has its own application context, by default defined in "{servlet-name}-servlet.xml",
  24. - i.e. "contacts-servlet.xml".
  25. -
  26. - A web app can contain any number of such servlets.
  27. - Note that this web app does not have a shared root application context,
  28. - therefore the DispatcherServlet contexts do not have a common parent.
  29. -->
  30. <servlet>
  31. <servlet-name>contacts</servlet-name>
  32. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  33. <load-on-startup>1</load-on-startup>
  34. </servlet>
  35. <!--
  36. - Maps the contacts dispatcher to /*.
  37. -
  38. -->
  39. <servlet-mapping>
  40. <servlet-name>contacts</servlet-name>
  41. <url-pattern>*.htm</url-pattern>
  42. </servlet-mapping>
  43. <welcome-file-list>
  44. <welcome-file>index.jsp</welcome-file>
  45. </welcome-file-list>
  46. <taglib>
  47. <taglib-uri>/spring</taglib-uri>
  48. <taglib-location>/WEB-INF/spring.tld</taglib-location>
  49. </taglib>
  50. <security-constraint>
  51. <display-name>Secured Area Security Constraint</display-name>
  52. <web-resource-collection>
  53. <web-resource-name>Secured Area</web-resource-name>
  54. <url-pattern>/secure/*</url-pattern>
  55. </web-resource-collection>
  56. <auth-constraint>
  57. <role-name>ROLE_TELLER</role-name>
  58. <role-name>ROLE_SUPERVISOR</role-name>
  59. </auth-constraint>
  60. </security-constraint>
  61. <!-- Default login configuration using BASIC authentication -->
  62. <!--
  63. <login-config>
  64. <auth-method>BASIC</auth-method>
  65. <realm-name>Spring Powered Realm</realm-name>
  66. </login-config>
  67. -->
  68. <!-- Default login configuration using form-based authentication -->
  69. <login-config>
  70. <auth-method>FORM</auth-method>
  71. <realm-name>Spring Powered Realm</realm-name>
  72. <form-login-config>
  73. <form-login-page>/login.jsp</form-login-page>
  74. <form-error-page>/login.jsp?login_error=1</form-error-page>
  75. </form-login-config>
  76. </login-config>
  77. <!-- Security roles referenced by this web application -->
  78. <security-role>
  79. <role-name>ROLE_SUPERVISOR</role-name>
  80. </security-role>
  81. <security-role>
  82. <role-name>ROLE_TELLER</role-name>
  83. </security-role>
  84. </web-app>