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根应用程序-context.xml放在何处?_Spring_Spring Mvc - Fatal编程技术网

在多模块应用程序中,将Spring根应用程序-context.xml放在何处?

在多模块应用程序中,将Spring根应用程序-context.xml放在何处?,spring,spring-mvc,Spring,Spring Mvc,我的web应用程序有两个模块: 核心(服务、存储库/dao、实体等) web(视图、控制器、转换器、过滤器等) web模块具有dispatcher-context.xml和Spring MVC定义 我不知道将Spring根应用程序上下文(Application Context.xml)和数据/JTA定义放在哪里——Web模块还是核心模块 提前谢谢 根应用程序上下文意味着包含应该对最终应用程序中的每个组件可用的bean。servlet应用程序上下文包含的bean应该只对DispatcherSe

我的web应用程序有两个模块:

  • 核心(服务、存储库/dao、实体等)
  • web(视图、控制器、转换器、过滤器等)
web模块具有dispatcher-context.xml和Spring MVC定义

我不知道将Spring根应用程序上下文(Application Context.xml)和数据/JTA定义放在哪里——Web模块还是核心模块


提前谢谢

根应用程序上下文意味着包含应该对最终应用程序中的每个组件可用的bean。servlet应用程序上下文包含的bean应该只对
DispatcherServlet
堆栈可用


Core应该包含根应用程序上下文,因为它声明了整个应用程序可用的服务、存储库和实体。

谢谢@SotiriosDelimanolis,但据我所知,在进一步研究之后,根应用程序-context.xml和servlet-context.xml都在web.xml中声明。所以两者都驻留在web模块中,对吗?@rperson小心,仅仅因为您在
web.xml
中声明了应用程序上下文位置并不意味着它必须在同一个包中。另一件需要考虑的事情是:你有很多Web模块吗?它们将使用相同的应用程序上下文吗?如果不是,那么每个web模块都有自己的应用程序上下文是有意义的。