No mapping found for HTTP request with URI [/SpringMVC/user.do] in DispatcherServlet with name 'springDispatcherServlet'
如果排除了主要配置问题,还可能的原因是
1.未加入<mvc:annotation-driven/>
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
2.如果自定义注解过滤器,可能是为加入Controller注解:
<context:component-scan base-package="com.spdb.framework,com.spdb.system"
use-default-filters="false">
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Repository" />
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Service" />
<!-- <context:include-filter type="annotation"
expression="org.springframework.stereotype.Controller"/> -->
</context:component-scan>
或者去掉use-default-filters="false"属性,直接使用默认的:
<context:component-scan base-package="com.spdb.framework,com.spdb.system"/>如此即可
3.springmvc需要jstl.jar