web.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. -->
  7. <web-app>
  8. <display-name>Contacts Sample Application</display-name>
  9. <description>
  10. Example of an application secured using Acegi Security System for Spring.
  11. </description>
  12. <filter>
  13. <filter-name>Acegi Security System for Spring</filter-name>
  14. <filter-class>net.sf.acegisecurity.adapters.AutoIntegrationFilter</filter-class>
  15. </filter>
  16. <filter-mapping>
  17. <filter-name>Acegi Security System for Spring</filter-name>
  18. <url-pattern>/*</url-pattern>
  19. </filter-mapping>
  20. <!--
  21. - Servlet that dispatches request to registered handlers (Controller implementations).
  22. - Has its own application context, by default defined in "{servlet-name}-servlet.xml",
  23. - i.e. "contacts-servlet.xml".
  24. -
  25. - A web app can contain any number of such servlets.
  26. - Note that this web app does not have a shared root application context,
  27. - therefore the DispatcherServlet contexts do not have a common parent.
  28. -->
  29. <servlet>
  30. <servlet-name>contacts</servlet-name>
  31. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  32. <load-on-startup>1</load-on-startup>
  33. </servlet>
  34. <!--
  35. - Maps the contacts dispatcher to /*.
  36. -
  37. -->
  38. <servlet-mapping>
  39. <servlet-name>contacts</servlet-name>
  40. <url-pattern>*.htm</url-pattern>
  41. </servlet-mapping>
  42. <welcome-file-list>
  43. <welcome-file>index.jsp</welcome-file>
  44. </welcome-file-list>
  45. <taglib>
  46. <taglib-uri>/spring</taglib-uri>
  47. <taglib-location>/WEB-INF/spring.tld</taglib-location>
  48. </taglib>
  49. <security-constraint>
  50. <display-name>Secured Area Security Constraint</display-name>
  51. <web-resource-collection>
  52. <web-resource-name>Secured Area</web-resource-name>
  53. <!-- Define the context-relative URL(s) to be protected -->
  54. <url-pattern>/secure/*</url-pattern>
  55. </web-resource-collection>
  56. <auth-constraint>
  57. <!-- Anyone with one of the listed roles may access this area -->
  58. <role-name>ROLE_TELLER</role-name>
  59. <role-name>ROLE_SUPERVISOR</role-name>
  60. </auth-constraint>
  61. </security-constraint>
  62. <!-- Default login configuration using BASIC authentication -->
  63. <!--
  64. <login-config>
  65. <auth-method>BASIC</auth-method>
  66. <realm-name>Spring Powered Realm</realm-name>
  67. </login-config>
  68. -->
  69. <!-- Default login configuration using form-based authentication -->
  70. <login-config>
  71. <auth-method>FORM</auth-method>
  72. <realm-name>Spring Powered Realm</realm-name>
  73. <form-login-config>
  74. <form-login-page>/login.jsp</form-login-page>
  75. <form-error-page>/login.jsp?login_error=1</form-error-page>
  76. </form-login-config>
  77. </login-config>
  78. <!-- Security roles referenced by this web application -->
  79. <security-role>
  80. <role-name>ROLE_SUPERVISOR</role-name>
  81. </security-role>
  82. <security-role>
  83. <role-name>ROLE_TELLER</role-name>
  84. </security-role>
  85. </web-app>