SPRINGMVC always unable to load annotations map, workaround
August 11, 2015 8:24:42 pm org.springframework.web.servlet.DispatcherServlet Initservletbean info: Frameworkservlet ' Mvc-dispatcher ': Initialization started August 11, 2015 8:24:42 PM Org.springframework.web.context.support.XmlWebApplicationContext Preparerefresh Info: Refreshing Webapplicationcontext for namespace ' Mvc-dispatcher-servlet ': startup date [Tue 20:24:42 CST 2015]; Parent:root Webapplicationcontext August 11, 2015 8:24:42 PM Org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadbeandefinitions Info: Loading XML Bean definitions From ServletContext resource [/web-inf/mvc-dispatcher-servlet.xml] August 11, 2015 8:24:43 PM Org.springframework.web.servlet.handler.SimpleUrlHandlerMapping Registerhandler Info: Mapped URL path [/**] onto handler ' Org.springframework.web.servlet.resource.resourcehttprequesthandler#0 ' August 11, 2015 8:24:43 PM Org.springframework.web.servlet.DispatcherServlet Initservletbean Info: Frameworkservlet ' mvc-dispatcher ': Initialization completed in 702 MS
Add <mvc:annotation-driven/> in Mvc-dispatcher-servlet.xml
August 11, 2015 8:22:17 pm org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping Registerhandlermethod Information:Mapped "{[//hello],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public Java.lang.String com.springapp.mvc.HelloController.printWelcome (ORG.SPRINGFRAMEWORK.UI.MODELMAP)August 11, 2015 8:22:18 pm org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter Initcontrolleradvicecache info: Looking for @ControllerAdvice: Webapplicationcontext for namespace ' Mvc-dispatcher-servlet ': startup date [Tue 20:22:17 CST 2015]; Parent:root Webapplicationcontext August 11, 2015 8:22:18 PM Org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter Initcontrolleradvicecache Information: Looking for @ControllerAdvice: Webapplicationcontext for namespace ' Mvc-dispatcher-servlet ': startup date [Tue 11 20:2 2:17 CST 2015]; Parent:root Webapplicationcontext August 11, 2015 8:22:18 PM Org.springframework.web.servlet.handler.SimpleUrlHandlerMapping Registerhandler Info: Mapped URL path [/**] onto handler ' Org.springframework.web.servlet.resource.resourcehttprequesthandler#0 ' August 11, 2015 8:22:18 PM Org.springframework.web.servlet.DispatcherServlet Initservletbean Info: Frameworkservlet ' mvc-dispatcher ': Initialization completed in 1131 MS
About
The part of the mvc-dispatcher-servlet.xml name is configured in Web. xml
<servlet>
<servlet-name>mvc-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
"Mapping" SPRINGMVC annotations mapping issues that are not valid