security.xml 1.3 KB
<beans:beans xmlns="http://www.springframework.org/schema/security"
	xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.xsd">


	<http access-denied-page="/error403.jsp">
		<intercept-url pattern="/" access="ROLE_USER,ROLE_ANONYMOUS" />
		<intercept-url pattern="/add*" access="ROLE_USER" />
		<intercept-url pattern="/delete/*" access="ROLE_ADMIN" />
		<form-login login-page="/login.jsp" default-target-url="/index"
			authentication-failure-url="/login.jsp?error=true" />
		<logout logout-url="/logout" logout-success-url="/index" />
		
		<anonymous username="guest" granted-authority="ROLE_ANONYMOUS" />
		<remember-me />
	</http>

	<authentication-manager>
		<authentication-provider>
			<user-service>
				<user name="admin" password="pass" authorities="ROLE_ADMIN,ROLE_USER" />
				<user name="user1" password="1111" authorities="ROLE_USER" />
				<user name="user2" password="2222" disabled="true" authorities="ROLE_USER" />
			</user-service>
		</authentication-provider>
	</authentication-manager>



</beans:beans>