please find below my security configuration:
in the above code, i was expecting /admin.htm and css page can only be access by ROLE_ADMIN user. but its accessible to every one.Code:<?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"> <global-method-security secured-annotations="enabled" jsr250-annotations="enabled" pre-post-annotations="enabled" /> <http use-expressions="true"> <intercept-url pattern="${root}/vikas/login.htm" access="hasAnyRole('ROLE_USER', 'ROLE_ADMIN')" /> <intercept-url pattern="${root}/vikas/admin.htm" access="hasRole(ROLE_ADMIN)" /> <intercept-url pattern="${root}/vikas/css/**" access="hasRole(ROLE_ADMIN)" /> <form-login login-processing-url="/j_spring_security_check" login-page="/jsp/login.jsp" authentication-failure-url="/jsp/login.jsp?login_error=true"/> <logout logout-url="/j_spring_security_logout" logout-success-url="/"/> <remember-me key="myAppKey" token-validity-seconds="864000" /> </http> <authentication-manager> <authentication-provider> <jdbc-user-service data-source-ref="myDataSource" users-by-username-query="select USER_NAME as username, PASSWORD, true from USER where USER_NAME = ? and STATUS='Active'"/> </authentication-provider> </authentication-manager> </beans:beans>
please tell me, where am going wrong? thank you.


