Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.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
我应该在Spring配置文件中设置什么层次结构?_Spring_Spring Mvc_Configuration_Spring Security - Fatal编程技术网

我应该在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上下

我目前正在我们的webapps中重构我们的Spring配置文件。现在,我按主题将它们分组:

/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加载,什么应该由子上下文加载?

我希望这个问题:它的答案对你有帮助,是的。我也想听听其他的选择。