警告: Unhandled exception
java.lang.NoSuchMethodException: Action[/dxye] does not contain specified method (check logs)struts-config.xml: <action-mappings> <action attribute="messForm" name="messForm" parameter="p"
path="/dxye" scope="request" type="com.actions.MessageAction"
cancellable="true">
<forward name="success" path="/index.jsp" />
</action>
</action-mappings>index.jsp:
<form action="dxye.do?p=dxye" method="post" name="dxyeForm">
<table>
<tr>
<td>
帐号
</td>
<td>
<input name="username" type="text">
</td>
</tr>
<tr>
<td>
密码
</td>
<td>
<input name="password" type="text">
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="提交">
</td>
</tr>
</table>
</form>
MessageAction.java:
public class MessageAction extends DispatchAction { // 网通
String urlwt = "www.lddxqf.cn";
// 电信
String urldx = "www.dxqf.net"; // 查看帐户余额
public ActionForward dxye(ActionForm form, ActionMapping mapping,
HttpServletRequest request, HttpServletResponse response)
throws IOException {
MessForm mf = (MessForm) form; // 帐户余额地址
String zhye = "softweb/login.asp";
StringBuilder stbu = new StringBuilder();
stbu.append(urldx);
stbu.append("/");
stbu.append(zhye);
stbu.append("?");
stbu.append("username=");
stbu.append(mf.getUsername());
stbu.append("& password =");
stbu.append(mf.getPassword()); response.sendRedirect(stbu.toString()); return new ActionForward("index.jsp", false);
}

解决方案 »

  1.   

    java.lang.NoSuchMethodException
    已经说明一切了。找不到你配置中那个方法。。
      

  2.   

    <action attribute="messForm" name="dxye" parameter="p"
      

  3.   

    还是找不到方法,
    这个name不是联系<form-bean name="messForm"的么?
      

  4.   

    错误提示确实是找不到方法呀,要不你这样改一下试试,方法名重新换掉一个
    <form action="dxye.do?action=dx" method="post" name="dxyeForm">配置文件改成:
    <action attribute="messForm" name="messForm" parameter="action"
    path="/dxye" scope="request" type="com.actions.MessageAction"
    cancellable="true">
      

  5.   

    <form action="<%=request.getContextPath()%>/dxye.do?p=dxye" method="post" name="dxyeForm">试试
      

  6.   

    个人感觉是form的名称错误!!!
      

  7.   

    很怀疑你struts 配置的有问题。其它action能找到不?
      

  8.   

    这是struts1
    就写了一个action测试用的。