站内搜索: 请输入搜索关键词

当前页面: 开发资料首页JSP 专题struts 使用LookDispatchAction出现错误:MAPPING configuration error for request URI

struts 使用LookDispatchAction出现错误:MAPPING configuration error for request URI

摘要: struts 使用LookDispatchAction出现错误:MAPPING configuration error for request URI


想要在数据库操作时,在查找得到的表中直接对相应记录删除。
.jsp是这样实现的
<table align=center border="15" cellspacing="2" width="89%">

<tr>
<th>用户名 </th><th>角色</th><th>删除</th>
</tr>

<tr>
<form action="/searchAction.do?expression=
<td></td>
<td></td>
<td>



</td>
</form >
</tr>

</table>

Action.java中是这样实现的:

public class searchAction extends LookupDispatchAction{

protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put("button.find", "find");
map.put("button.show_all", "show_all");
map.put("button.remove", "remove");
return map;
}

public ActionForward show_all...;
public ActionForward find...;
public ActionForward remove...;
}

资源文件ApplicationResources.properties中这样改的:
button.find=find
button.show_all=show_all
button.remove=remove

出现错误提示:MAPPING configuration error for request URI 和No Context configured to process this request


我以前用LookupDispatchAction实现一个form多个按钮都是这样做的,也没问题。不知这里是错在哪里。




确定form里面action写的路径正确吗?

也许是/XXX/searchAction.do?XXX=XXX

贴struts-config.xml出来看看


action的路径OK
struts-config.xml如下:
<?xml version="1.0" encoding="UTF-8"?>
struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<form-beans>
<form-bean name="myActionForm" type="project.myActionForm" />
</form-beans>














还缺一部分:






兄弟6:30就上班了?..辛苦..

form-beans里searchActionForm好象没配啊


不对吧。LookupDispatchAction是针对一个form包含多个submit的。
可按你的逻辑是一个画面包含多个form,一个form只有一个submit。
用法有问题啊!


首先感谢你一直关注我的问题。
是这样,我想实现的是多个多个form,多个submit。
你看我的程序可以看出,我要显示出多条记录,希望对每条记录进行删除、编辑等操作,每条记录一个form,每个form里包括这些操作的submit,这样我可以取出这条记录的id用于操作。
假如这样不行的话,有什么方法可以实现。请教。最好可以贴出源程序。


问题解决了,哈哈。


↑返回目录
前一篇: 关于jsp tag使用的难题
后一篇: 谁能提供js+div的一些效果?