Java 有条件的春季安全
我希望有一个spring安全性,它应该可以通过一个布尔标志来配置——打开/关闭一类功能 比如说,Java 有条件的春季安全,java,spring,spring-security,Java,Spring,Spring Security,我希望有一个spring安全性,它应该可以通过一个布尔标志来配置——打开/关闭一类功能 比如说, <bean class="org.springframework.ws.server..."> <property name="interceptors"> <list> ----> Here I would like an if condition test based on external property i.e. if true, register
<bean class="org.springframework.ws.server...">
<property name="interceptors">
<list>
----> Here I would like an if condition test based on external property i.e. if true, register the interceptor, else do nothing
<ref local="wsSecurityInterceptor">
--> other interceptors like logging etc.
</list>
</property>
</bean>
---->这里我想要一个基于外部属性的if条件测试,即如果为true,注册拦截器,否则什么都不做
-->其他拦截器,如日志记录等。
这在config.xml中可能吗?非常感谢。如果您使用的是Spring 3.1,您可以尝试使用名为Profile的新功能
如果您需要更多详细信息,请告诉我。您可以执行以下操作:
<security:intercept-url pattern="/api/**" access="isAuthenticated() and #{SAMLUtil.isStateOne()}" />
其中#{boolean_function}似乎与此类讨论相关。