今日遇到一问题,在页面中请求Action时,后台抛出如下错误:
java.lang.NoSuchMethodException: com.opensymphony.xwork2.ActionSupport.xxxxxxxxMethod()
原因大概有以下几种:
1、在struts.xml中没有include相关的action配置文件
2、在struts.xml中include文件的路径错误
3、页面中的action路径和struts配置文件中的namespace等路径不匹配
以上是我遇到的问题和解决方法。总之,页面中的action路径一定是要在struts配置文件中有注册过且完全匹配。