Dowemo
0 0 0 0

I've written a simple case after I springmvc spring spring, but neither do you go into controller controller, find a long after a long time, and it's a mistake. See:

In the springmvx servlet. Xml:

<!-- 配置HandlerMapping映射,根据beanname找到对应的Controller -->
 <bean class="org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping"></bean>
 <!-- 配置Controller -->
 <bean name="hello.do" class="org.controller.HelloController"></bean> <!-- 配置视图解析器 -->
 <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
 <!-- 配置前缀和后缀 -->
 <property name="prefix" value="/"></property>
 <!-- 后缀 -->
 <property name="suffix" value=".jsp"></property>
 </bean>

Note the red font section, change to:
<!-- 配置HandlerMapping映射,根据beanname找到对应的Controller -->
 <bean class="org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping"></bean>
 <!-- 配置Controller -->
 <bean id="hello.do" class="org.controller.HelloController"></bean>
 <!-- 配置视图解析器 -->
 <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
 <!-- 配置前缀和后缀 -->
 <property name="prefix" value="/"></property>
 <!-- 后缀 -->
 <property name="suffix" value=".jsp"></property>
 </bean>

Problem resolution: run successfully!



Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs