条件弹簧安全

Sai*_*Sai 3 java spring spring-security

我希望弹簧安全性应该通过布尔标志 - 开关开启/关闭功能来配置.

例如,

<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>
Run Code Online (Sandbox Code Playgroud)

这在config.xml中是否可行?非常感谢.

Ket*_*tan 5

如果您使用的是Spring 3.1,则可以尝试使用名为Profile的新功能.一个例子

如果您需要更多细节,请告诉我.