I get some problem using spring MVC Here is my web.xml config
<context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/classes/applicationContext.xml, /WEB-INF/classes/xfire-servlet.xml, /WEB-INF/classes/mvc-servlet.xml, classpath:org/codehaus/xfire/spring/xfire.xml </param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <listener> <listener-class> org.springframework.web.util.IntrospectorCleanupListener </listener-class> </listener> <servlet> <servlet-name>mvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>mvc</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping>
My controller is watching
@Controller @RequestMapping("/searchCase.do") public class SearchCaseController { public String getCaseDetailInfo() { return "forward:caseDetail"; } }
and my mvc configuration
<context:component-scan base-package="com.thunisoft.shxt.webservice.model.searchCase.logic" /> <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/case" /> <property name="suffix" value=".jsp" /> </bean>
Then I request the url: http: // {address: port} / {application-name} /searchCase.do, But it cannot find the controller to resolve my request with
No handler found in getLastModified DispatcherServlet with name 'mvc' processing request for [/{application-name}/searchCase.do] No mapping found for HTTP request with URI [/{application-name}/searchCase.do] in DispatcherServlet with name 'mvc' Successfully completed request
My spring MVC version is 2.5.6. I am waiting for your questions to help me solve this problem, thanks!
source share