java.lang.NoSuchMethodException:在struts 1.3。*中

时间:2012-10-23 05:06:51

标签: java struts struts-1 http-method

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

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>

这是我的动作类方法:

public ActionForward goToHome(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        //call method to verify Pagetoken
        forwardRequestTo = "departmentHome";
        return mapping.findForward(forwardRequestTo);
    }

这就是我在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。

1 个答案:

答案 0 :(得分:0)

在动作中,tag参数应该用goToHome包装,即{。{1}}