警告: 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);
}
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);
}
解决方案 »
- isErrorPage错误的操作~~~
- 请教JSP/Servle如何访问Domino Database7.0(急!!!)
- 在服务器端如何配置500异常?
- 提问:http://localhost:8080无法进入tomcat,http://127.0.0.1:8080却可以
- 请教JasperReports的中文问题
- 通过表单修改数据产生换行等转义字符,请问如何解决啊?
- 痛苦了很久,我终于鼓起勇气来问了!应该不算菜菜的问题!关于STRUTS的
- 微软不支持JVM,到底对JSP网站有什么影响?2007年我该怎么办?
- 如果action的时候from加入ENCTYPE="multipart/form-data"!!!关于文件上传啊!
- 谁有网上销售系统(如网上书店),高分相送!不够狂加!
- table 里面可以套talbe吗?
- 悲剧的程序员!
已经说明一切了。找不到你配置中那个方法。。
这个name不是联系<form-bean name="messForm"的么?
<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">
就写了一个action测试用的。