java.lang.NoSuchMethodException: Action[/main] does not contain specified method

lihao1129 2009-08-17 09:47:00
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'showlist.jsp' starting page</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="CSS/table.css" type="text/css">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<script type="text/javascript" src="dwr/engine.js"></script>
<script type="text/javascript" src="dwr/util.js"></script>
<script type="text/javascript" src="dwr/interface/service.js"></script>

<script type="text/javascript" src="js/comm.js"></script>
<style>
.mouseover {
background-color: #FFFFFF;
}
.mouseout {
background-color: #AAAAAA;
}
</style>
<script type="text/javascript">
function toAdd(){
document.forms[0].action+="?method=toAdd";
document.forms[0].submit();
}
function dolist(){
document.forms[0].action+="?method=dolist";
document.forms[0].submit();
}
function toDel(id)
{
document.forms[0].action+="?method=toDelete&id="+id;
document.forms[0].submit();
}
function toUpdate(id)
{
document.forms[0].action+="?method=toUpdate&id="+id;
document.forms[0].submit();
}
function mouseover(id)
{
id.className = "mouseover";
}
function mouseout(id)
{
id.className = "mouseout";
}
</script>
</head>



<body>
<form method="post" action="main.do">

<!-- -->
<table width="100%">
<tr>
<td>
<font color="#0000CC">您正在做的业务是:数 据</font>
</td>
</tr>
</table>
<tr>
<td>
<select name="hdCorporation"
style="SELECT_STYLE2">
<option value="1">--公司--</option>
<logic:iterate name="pb" id="list" property="currentList">
<option value="2">
${list.corporation.corporationName}
</logic:iterate>
</select>
</td>
</tr>
<tr>
<td>件 号:<input type="text" name="hdmainArticleId"></td>
<td>章节号:<input type="text" name="hdmainAta"></td>
</tr>
<td><input type="button" value="添加" onclick="javascript:toAdd();"></input></td>
<td><input type="button" value="查询" onclick="javascript:dolist();"></input></td>

<table width="100%" border="1" cellpadding=0 cellspacing=1
bordercolorlight=#848284 bordercolordark=#eeeee class="TABLE_STYLE1">

<tr align="center">
<td width="8%" class="TD_STYLE1">公司名称</td>
<td width="8%" class="TD_STYLE1">ATA章节号</td>
<td width="12%" class="TD_STYLE1">件号</td>
<td width="8%" class="TD_STYLE1">测试(工时)</td>
<td width="8%" class="TD_STYLE1">修理(工时)</td>
<td width="8%" class="TD_STYLE1">翻修(工时)</td>
<td width="8%" class="TD_STYLE1">修理(固定)</td>
<td width="8%" class="TD_STYLE1">翻修(固定)</td>
<td width="8%" class="TD_STYLE1">保修期</td>
<td width="8%" class="TD_STYLE1">周期</td>
<td width="8%" class="TD_STYLE1">报价日期</td>
<td width="8%" class="TD_STYLE1">操作</td>
</tr>


<logic:iterate name="pb" id="list" property="currentList">
<tr align="center" class="TD_STYLE2">
<td>${list.corporation.corporationName}</td>
<td>${list.articleId.articleIdAta}</td>
<td>${list.articleId.articleIdName}</td>
<td>${list.mainManhourTest}</td>
<td>${list.mainManhourRepair}</td>
<td>${list.mainManhourOverhaul}</td>
<td>${list.mainImmobilityRepair}</td>
<td>${list.mainImmobilityOverhaul}</td>
<td>${list.mainWarrantyTime}</td>
<td>${list.mainCycle}</td>
<td>${list.hddate.dateData}</td>
<td>
<a href="javascript:toUpdate('${list.mainId}');">更新</a>
<a href="javascript:toDel('${list.mainId}');">删除</a>
</td>
</tr>
</logic:iterate>

</table>

<table align="center" class="TD_STYLE9">
<tr>
<td>
总记录数${pb.allRecord}条记录,总页数有${pb.allPage}页,当前是${pb.currentPage}页
从第${pb.first+1}条记录到第${pb.last+1}条记录
</td>
</tr>
<tr>
<td>
<logic:equal value="1" name="pb" property="currentPage">
首页 上一页
</logic:equal>
<logic:greaterThan value="1" name="pb" property="currentPage">
<a href="main.do?page=1">首页</a>
<a href="main.do?page=${pb.currentPage-1}">上一页</a>
</logic:greaterThan>
<logic:equal value="${pb.allPage}" name="pb"
property="currentPage">
下一页 尾页
</logic:equal>
<logic:lessThan value="${pb.allPage}" name="pb"
property="currentPage">
<a href="main.do?method&list=${pb.currentPage+1}">下一页</a>
<a href="main.do?method&list=${pb.allPage}">尾页</a>
</logic:lessThan>

<input type="text" name="page" size="2">
<input type="submit" value="转到">

<a href="index.jsp">返回</a>
</td>
</tr>
</table>

</form>
</body>

</html>


action 里的
public ActionForward list(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
System.out.println("aaaaaaaaaaaaaaaa");
String scp = request.getParameter("page");
HdmainForm hf = (HdmainForm)form;
//因为JSP使用的DISPLAY标签的中文标签d-1773-p,替代了以前的page
PageBean pb = new PageBean();
pb.setAllRecord(hdmainBiz.count(hf));
pb.count(scp);
pb.setCurrentList(hdmainBiz.query(pb.getFirst(), pb.getSize(),hf));
request.setAttribute("pb", pb);
return mapping.findForward("showlist");
}

uitl下 有这个PageBean的 方法

一点下一页就出错,应该是页面上的下一页路径问题,但是我看了半天感觉没有错误
...全文
1200 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lihao1129 2009-08-17
  • 打赏
  • 举报
回复
呵呵,我刚才修改测试的..谢谢你
好吃的松子 2009-08-17
  • 打赏
  • 举报
回复
<a href="main.do?page=1">首页</a>
<a href="main.do?page=${pb.currentPage-1}">上一页</a>
<a href="main.do?method&list=${pb.currentPage+1}">下一页</a>
<a href="main.do?method&list=${pb.allPage}">尾页</a>



为什么这么不一样呢?
链接好像应该是main.do?method=list&page=**吧

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧