@Controller问题!
访问list.do出错,HTTP Status 500 - No action instance for path /list could be created
package com.wsc.web.action.product;
...
import org.springframework.stereotype.Controller;
...
@Controller("/list")
public class ProductTypeAction extends Action {
.....
return mapping.findForward("list");
}
struts-config.xml 是:
<form-beans>
<form-bean name="producttypeform" type="com.wsc.web.formbean.product.ProductTypeForm"/>
</form-beans>
<action-mappings>
<action path="/list" name="producttypeform" scope="request">
<forward name="list" path="/WEB-INF/page/product/producttypelist.jsp"/>
</action>
<action-mappings>
beans.xml 是:
<context:component-scan base-package="com.wsc"/>
------解决方案--------------------你访问的路径是什么啊??看着报错的,应该是没找到action方法
------解决方案--------------------是不是spring没配置的好啊
------解决方案--------------------
@Controller注解一个类为action的时候:
第一、如果是springmvc,配置的请求路径是@RequestMapping(value="/list").例如:
Java code
@Controller
@RequestMapping(value="/list")
public class CustomConstroller {