【发布时间】:2016-03-22 08:23:52
【问题描述】:
我的 spring 上下文中有以下配置:
<beans profile="!prof1" >
<security:authentication-manager id="authenticationManager" erase-credentials="true">
<security:authentication-provider ref="1" />
<security:authentication-provider ref="2" />
<security:authentication-provider ref="3" />
</security:authentication-manager>
</beans>
<beans profile="prof1" >
<security:authentication-manager id="authenticationManager" erase-credentials="true">
<security:authentication-provider ref="0" />
<security:authentication-provider ref="1" />
<security:authentication-provider ref="2" />
<security:authentication-provider ref="3" />
</security:authentication-manager>
</beans>
存在将解析哪些<beans> 元素的问题:
prof1 和 prof2 配置文件已激活。
看起来它总是选择这个<beans profile="prof1" >,但不知道为什么它不选择另一个<beans profile="!prof1" >。我可以转发它总是会选择<beans> 而不带感叹号吗?
【问题讨论】:
标签: java spring spring-profiles