Spring security 是否可以使用;hasRole“;使用属性占位符?
是否可以将“hasRole”与属性占位符中的属性一起使用?我不能让它工作。使用属性占位符中的属性可以很好地定义my applicationContext-security.xml中的bean 有解决方法的建议吗 我在日志中得到以下信息:Spring security 是否可以使用;hasRole“;使用属性占位符?,spring-security,Spring Security,是否可以将“hasRole”与属性占位符中的属性一起使用?我不能让它工作。使用属性占位符中的属性可以很好地定义my applicationContext-security.xml中的bean 有解决方法的建议吗 我在日志中得到以下信息: INFO 25.11.2015 15:35:44:999 (FilterInvocationSecurityMetadataSourceParser.java:parseInterceptUrlsForFilterInvocationRequestMap:13
INFO 25.11.2015 15:35:44:999 (FilterInvocationSecurityMetadataSourceParser.java:parseInterceptUrlsForFilterInvocationRequestMap:134) - Creating access control expression attribute 'hasRole('${myrole}')' for /protected.html
我使用以下xml:
<s:intercept-url pattern="/protected.html" access="hasRole('${myrole}')" />
及
我使用的是Spring 4.2.2.RELEASE和Spring security 3.2.8.RELEASE
谢谢
-Kaj:)看一看:谢谢你的链接!:)
<context:property-placeholder location="classpath:project.properties"
ignore-resource-not-found="false" ignore-unresolvable="true" order="1" />