struts2版本 2.3.24 报错如下
java.lang.NoSuchMethodException: com.test.action.LoginAction.index()
ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1246)
ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117)
action类如下:
package com.test.action;
import com.opensymphony.xwork2.ActionSupport;
public class LoginAction extends ActionSupport {
private String hello;
public String execute() throws Exception {
return "a";
}
public String hello(){
hello="123";
return "a";
}
public String getHello() {
return hello;
}
public void setHello(String hello) {
this.hello = hello;
}
}
struts.xml 文件如下:
===================问题已经解决了=========================
之前用的是struts-2.3.4-all里一个war包里lib中的jar包,换了一批jar包之后就正常运行了。应该是jar包的问题。