Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 有条件的春季安全_Java_Spring_Spring Security - Fatal编程技术网

Java 有条件的春季安全

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

我希望有一个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 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}

似乎与此类讨论相关。