struts1+hibernate+spring2中NoSuchMethodException 本帖最后由 Renliqun7 于 2010-04-23 22:42:09 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 错误提示了。Action中提示没有特别的方法。login方法不认识。你改为execute试试 public ActionForward login(ActionMapping arg0, ActionForm arg1,HttpServletRequest arg2, HttpServletResponse arg3) throws Exception {System.out.println("进入dengluaction"); return arg0.findForward("index3");} 参数类型要和execute一致。可能是这样。 <html:form action="/denglu.do?op=login" method="post">少了一/ Userbizimpl userbiz;这里是action UserAction 配置文件里面指定的方法在ACTION里面没有声明,或格式不正确,配置文件和程序的映射关系很重要。 这个问题我遇到过!是参数的问题!建议你重新建个action 把execute方法复制到当前的的action里面再改方法名 你写错了一下擦数才是正确的(ActionMapping mapping,ActionForm form, HttpServletRequest request,HttpServletResponse response ) 你先用Form 接受下页面传进来的参数,xml文件里面的写完整,看看web.xml里面有没有配Spring配置文件的路径,并且监听。你放在这里的代码应该都是正常的。 struts1中 所截取的path 并不是仅仅是你的action="denglu.do 后面去掉.do你可以看看当前的路径 是不是webroot下 否则要跟从webroot后一直到.do前面才能匹配到struts-config.xml中的path public class UserAction extends DispatchAction {Userbizimpl userbiz;public Userbizimpl getUserbiz() {return userbiz;}public void setUserbiz(Userbizimpl userbiz) {this.userbiz = userbiz;}public ActionForward login(ActionMapping arg0, ActionForm arg1,ServletRequest arg2, ServletResponse arg3) throws Exception {System.out.println("进入dengluaction"); return arg0.findForward("index3");} 这个action方法中 Userbizimpl userbiz; 是由spring注入的 并不需要get方法 Openmeetings安装问题 myeclipse 6 集成svn插件 建资源库报错咋解决啊 ubuntu server 用tomcat6部署jsp工程的问题 短信群发如何办理? 在线等,如何利用jsp标签动态创建多列表格..我等了老半天了,还是不行. 初学者求助!! 下拉列表一问 一个项目,tomcat配置2个端口。 *****一个问题好长时间没解决,我要急疯了!!!大伙救救我吧***** 求大神帮忙解答下 eclipse jee tomcat警告问题 看着ColorBox官网的例子做的有问题,麻烦指点一下
login方法不认识。你改为execute试试
HttpServletRequest arg2, HttpServletResponse arg3) throws Exception {
System.out.println("进入dengluaction");
return arg0.findForward("index3");} 参数类型要和execute一致。可能是这样。
少了一/
一下擦数才是正确的
(ActionMapping mapping,ActionForm form,
HttpServletRequest request,HttpServletResponse response )
你可以看看当前的路径 是不是webroot下 否则要跟从webroot后一直到.do前面才能匹配到struts-config.xml中的path
Userbizimpl userbiz;
public Userbizimpl getUserbiz() {
return userbiz;
}
public void setUserbiz(Userbizimpl userbiz) {
this.userbiz = userbiz;
}
public ActionForward login(ActionMapping arg0, ActionForm arg1,
ServletRequest arg2, ServletResponse arg3) throws Exception {
System.out.println("进入dengluaction");
return arg0.findForward("index3");}
这个action方法中 Userbizimpl userbiz; 是由spring注入的 并不需要get方法