Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java.lang.NoSuchMethodException:在struts 1.3中*_Java_Struts_Struts 1_Http Method - Fatal编程技术网

java.lang.NoSuchMethodException:在struts 1.3中*

java.lang.NoSuchMethodException:在struts 1.3中*,java,struts,struts-1,http-method,Java,Struts,Struts 1,Http Method,我有一个action类,它具有我调用的方法,但仍然得到以下异常 SEVERE: Action[/common/DepartmentAction] does not contain method named '' java.lang.NoSuchMethodException: com.secureyes.eswastha.struts.action.DepartmentAction.(org.apache.struts.action.ActionMapping, org.apache.strut

我有一个action类,它具有我调用的方法,但仍然得到以下异常

SEVERE: Action[/common/DepartmentAction] does not contain method named ''
java.lang.NoSuchMethodException: com.secureyes.eswastha.struts.action.DepartmentAction.(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
我真的很困惑为什么我会得到这种例外

这是我的操作struts-config.xml:

<action path="/common/DepartmentAction"  name="SecurEyesForm" type="com.secureyes.eswastha.struts.action.DepartmentAction" scope="request" parameter="method" validate="false">
            <forward name="departmentHome" path="/WEB-INF/Masters/DepartmentMaster.jsp"></forward>            
        </action>
这就是我在java脚本中调用方法的方式:

function dataSave(){

                document.forms[0].action="DepartmentAction.htm";
                document.forms[0].method.value="saveDepartmentDetails";
                document.forms[0].target="workFrame";
                document.forms[0].submit();   
            }
有什么问题吗


我使用了frameset。

在action中,标记参数应该用goToHome包装,即,
parameter=“goToHome”
函数dataSave()这是有效的方法吗?如果您使用的是Struts 1.2,那么您的action类方法不应该是action吗?这是一个查找分派操作吗?import org.apache.Struts.actions.DispatchAction;你在浏览器中看到了什么URL(应该是
http://localhost:8080/yourapp/DepartmentAction.htm?method=saveDepartmentDetails
)。您应该在action类中使用
(ActionMapping映射,ActionForm表单,HttpServletRequest请求,HttpServletResponse响应)
参数创建一个具有该名称的方法。@BheshGurung,谢谢您的评论,没有显示URl。我试图设置method=“get”,但仍然没有得到任何URL
function dataSave(){

                document.forms[0].action="DepartmentAction.htm";
                document.forms[0].method.value="saveDepartmentDetails";
                document.forms[0].target="workFrame";
                document.forms[0].submit();   
            }