我应该在Spring配置文件中设置什么层次结构?
我目前正在我们的webapps中重构我们的Spring配置文件。现在,我按主题将它们分组:我应该在Spring配置文件中设置什么层次结构?,spring,spring-mvc,configuration,spring-security,Spring,Spring Mvc,Configuration,Spring Security,我目前正在我们的webapps中重构我们的Spring配置文件。现在,我按主题将它们分组: /WEB-INF/spring ./mvc/servlet-context.xml ./cache.xml ./root-context.xml ./security.xml /*.xml由ContextLoaderListener加载,后者是Spring根上下文,/mvc/*.xml中的所有内容都由DispatcherServlet的子上下文加载 我知道如果通过dispatcher上下
/WEB-INF/spring
./mvc/servlet-context.xml
./cache.xml
./root-context.xml
./security.xml
/*.xml
由ContextLoaderListener
加载,后者是Spring根上下文,/mvc/*.xml
中的所有内容都由DispatcherServlet的子上下文加载
我知道如果通过dispatcher上下文加载security.xml
,那么父上下文将看不到所有bean
现在,加载程序层次结构应该是这样的吗?什么应该由root加载,什么应该由子上下文加载?我希望这个问题:它的答案对你有帮助,是的。我也想听听其他的选择。