My SpringMVC-based web server typically uses 2 contexts: the webapplication context for the MVC dispatcher servlet and the context of the parent / root application.
<servlet>
<servlet-name>webApp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
....
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:root-context.xml</param-value>
</context-param>
In these contexts, I use component scanning to load all the beans. My packages are named according to their usecase (e.g. com.abc.registration, com.abc.login, etc.), and not based on the technological level (e.g. com.abc.dao, com.abc.services and etc.).
: , - , . MVC- - ( dao/repositorie) ?
<context:component-scan base-package="com.abc.myapp" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<context:component-scan base-package="de.efinia.webapp">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
?