I have a spring dispatcher servlet with the servlet name "spring -mvc". spring -mvc-servlet.xml is as follows:
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
In the file in WEB-INF / annotation-context.xml, I have an annotation scanner installed. All my annotated classes are loading, and other spring beans can load them in order.
However, path mappings do not work from spring -mvc. If I copy the context scanner to spring -mvc-servlet.xml, then they will work.
Is it possible for spring -mvc-servlet.xml to refer to beans defined globally by spring?
source share