struts 使用LookDispatchAction出现错误:MAPPING configuration error for request URI
想要在数据库操作时,在查找得到的表中直接对相应记录删除。
.jsp是这样实现的
<table align=center border="15" cellspacing="2" width="89%"> <br>
<tr>
<th>用户名 </th><th>角色</th><th>删除</th>
</tr>
<logic:iterate id="rs" name="queryResult">
<tr>
<form action="/searchAction.do?expression=<bean:write name='rs' property='username' />">
<td><bean:write name="rs" property="username" /></td>
<td><bean:write name="rs" property="role" /></td>
<td>
<html:submit property="method">
<bean:message key="button.remove"/>
</html:submit>
</td>
</form >
</tr>
</logic:iterate>
</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多个按钮都是这样做的,也没问题。不知这里是错在哪里。