[ECSide] ecside 存在多次执行Action的bug

changkui 2007-04-04
在经典的struts中使用ecside组件,对于存在分页的情况,会多次执行Action。
拿ecside1.3中的demo: 传统Action/servlet方式,当点击该链接时,会发现程序会连续两次执行相应的Action,同时后天会输出以下信息:2007-4-4 13:33:33 org.apache.tomcat.util.http.Parameters processParameters
警告: Parameters: Invalid chunk ignored.
对于单页情况,不存在上述问题!
请作者检查一下该问题! 谢谢!
fins 2007-04-04
两次是正常的 因为会预读取下一页 你说的Parameters: Invalid chunk ignored问题我再查一下吧
谢谢提示
小天蝎 2007-04-27
我这里也出现了同样的情况
网上搜索没找到什么信息
joe_qlb 2007-04-27
我这边也有Parameters: Invalid chunk ignored提示
sharong 2007-04-29
我在页面链接中使用struts的.do方式,通过action类后进入包含ecside标签的列表页,显示为空白页,页面左下方js总是提示edsideutil未定义,查了一下,这是个js变量,在ecside.js里有定义,我已经在页头引入了ecside.js。
而当我按照ecside2.0带的例子那样偷懒,将获得结果集的代码写在页面上时,却可以正确显示页面,这是bug还是不支持这种功能?

另外:即使按照后面的方式获得结果集,翻页功能似乎不起作用,左上角显示正在提交后,页面就一直处于运行状态了,好几分钟后仍然是那样。
在控制台上打印了大概十几个select语句,大致如下:
Hibernate: select tdship0_.PORT_SHIP_SEQ as PORT1_0_, tdship0_.SHIP_ID as SHIP2_0_, ... ... from td_ship tdship0_ where 1=1
所有的sql语句都相同,似乎是死循环
fins 2007-04-29
STRUTS版本?
还有能否把JSP页面帖上来看看 谢谢
sharong 2007-04-30
程序的架构为struts1.x+spring1.2.9+hibernate3.2.3
如果我在Action类里编写如下代码
public class DemoAction extends DispatchAction {
	private static final Log logger = LogFactory.getLog(DemoAction.class);
	public ActionForward search(ActionMapping mapping, ActionForm form, HttpServletRequest request, 
			HttpServletResponse response) {		

		List list = demoService.getTdShipList();
		
		request.setAttribute("records", list);
		logger.info(DemoAction.class + " readlly to forward the list page ... ");
		
		return mapping.findForward("demolist");
	}
}

那么跳转至demoList.jsp时,显示为空白页,页面左下方js总是提示edsideutil未定义,demoList.jsp的代码和democlassic.jsp基本一致,就是在页面去掉了获得records的java代码,同时,页头显示如下:
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/ecside.tld" prefix="ec" %>

不知道为什么我直接使用<%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>程序报错,只好改成本地tld文件了,现在都是jsp1.2了吧
而jsp页面中,类似democlassic.jsp那样来获得records集合时,列表页的首页是可以显示的,只是翻页出现等待。
sharong 2007-04-30
这是我的服务端解释jsp后生成的静态文件的内容:






<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<meta http-equiv="MSThemeCompatible" content="no" />
<link rel="stylesheet" type="text/css" href="/Seaport/css/ecside_style.css" />
<script type="text/javascript" src="/Seaport/js/prototype_mini.js"></script>	
<script type="text/javascript" src="/Seaport/js/ecside.js"></script>
<title>Demo</title>
</head>
<body>



<form id="ec"  method="post"  style="width:100%;visibility :hidden;"  nearPages="3"  maxRowsExported="1000000"  minColWidth="45" 
 action="/Seaport/demo/demo.do?operation=search" >
<div class="ecSide"  id="ec_main_content"  style="width:100%;" >
<!-- ECS_AJAX_ZONE_PREFIX__begin_ ec_ECS_AJAX_ZONE_SUFFIX -->
<div>
<input type="hidden"  name="ec_i"  value="ec" />
<input type="hidden"  name="ec_efn" />
<input type="hidden"  name="ec_crd"  value="10" />
<input type="hidden"  name="ec_p"  value="1" />
<input type="hidden"  name="ec_s__0" />
<input type="hidden"  name="ec_s_shipNameCn" />
<input type="hidden"  name="ec_s_voyageNo" />
<input type="hidden"  name="ec_s_totalTons" />
<input type="hidden"  name="ec_s_toCountry" />
<input type="hidden"  name="operation"  value="search" />
<input type="hidden"  name="ec_totalpages"  value="12" />
<input type="hidden"  name="ec_totalrows"  value="114" />
</div>
<div style="width:100%;"  class="gridTitle" >Demo列表</div>

<table id="ec_table"  border="0"  cellspacing="0"  cellpadding="0"  class="tableRegion"  width="100%"    >
	<thead id="ec_table_head" ><tr><td valign="middle"  columnName="_0"  sortable="true"  editTemplate="ecs_t_input"  width="50"  class="tableHeader"  onmouseover="ECSideUtil.lightHeader(this,'ec');"  onmouseout="ECSideUtil.unlightHeader(this,'ec');"  oncontextmenu="ECSideUtil.showColmunMenu(event,this,'ec');"  onmouseup="ECSideUtil.doSort(event,'_0','asc','ec');"  title="排序 序号" ><span class="columnSeparator" >&#160;</span><div class="headerTitle" >序号</div></td>
<td valign="middle"  columnName="shipNameCn"  sortable="true"  editTemplate="ecs_t_input"  width="200"  class="tableHeader"  onmouseover="ECSideUtil.lightHeader(this,'ec');"  onmouseout="ECSideUtil.unlightHeader(this,'ec');"  oncontextmenu="ECSideUtil.showColmunMenu(event,this,'ec');"  onmouseup="ECSideUtil.doSort(event,'shipNameCn','asc','ec');"  title="排序 中文船名" ><span class="columnSeparator" >&#160;</span><div class="headerTitle" >中文船名</div></td>
<td valign="middle"  columnName="voyageNo"  sortable="true"  editTemplate="ecs_t_input"  class="tableHeader"  onmouseover="ECSideUtil.lightHeader(this,'ec');"  onmouseout="ECSideUtil.unlightHeader(this,'ec');"  oncontextmenu="ECSideUtil.showColmunMenu(event,this,'ec');"  onmouseup="ECSideUtil.doSort(event,'voyageNo','asc','ec');"  title="排序 航次号" ><span class="columnSeparator" >&#160;</span><div class="headerTitle" >航次号</div></td>
<td valign="middle"  columnName="totalTons"  sortable="true"  editTemplate="ecs_t_input"  width="50"  class="tableHeader"  onmouseover="ECSideUtil.lightHeader(this,'ec');"  onmouseout="ECSideUtil.unlightHeader(this,'ec');"  oncontextmenu="ECSideUtil.showColmunMenu(event,this,'ec');"  onmouseup="ECSideUtil.doSort(event,'totalTons','asc','ec');"  title="排序 货物总吨数" ><span class="columnSeparator" >&#160;</span><div class="headerTitle" >货物总吨数</div></td>
<td valign="middle"  columnName="toCountry"  sortable="true"  editTemplate="ecs_t_input"  width="200"  class="tableHeader"  onmouseover="ECSideUtil.lightHeader(this,'ec');"  onmouseout="ECSideUtil.unlightHeader(this,'ec');"  oncontextmenu="ECSideUtil.showColmunMenu(event,this,'ec');"  onmouseup="ECSideUtil.doSort(event,'toCountry','asc','ec');"  title="排序 抵达港国家名称" ><span class="columnSeparator" >&#160;</span><div class="headerTitle" >抵达港国家名称</div></td>
</tr>
	</thead>
	<tbody id="ec_table_body" >
<tr class="odd "  onclick="ECSideUtil.selectRow(this,'ec');"  onmouseover="ECSideUtil.lightRow(this,'ec');"  onmouseout="ECSideUtil.unlightRow(this,'ec');"   >
<td width="50"   >1</td>
<td width="200"   >恒裕</td>
<td  >0427W</td>
<td width="50"   >00293895</td>
<td width="200"   >&#160;</td>
</tr>

<tr class="even "  onclick="ECSideUtil.selectRow(this,'ec');"  onmouseover="ECSideUtil.lightRow(this,'ec');"  onmouseout="ECSideUtil.unlightRow(this,'ec');"   >
<td width="50"   >2</td>
<td width="200"   >新重庆</td>
<td  >PX036W</td>
<td width="50"   >00433719</td>
<td width="200"   >&#160;</td>
</tr>

<tr class="odd "  onclick="ECSideUtil.selectRow(this,'ec');"  onmouseover="ECSideUtil.lightRow(this,'ec');"  onmouseout="ECSideUtil.unlightRow(this,'ec');"   >
<td width="50"   >3</td>
<td width="200"   >德利明珠</td>
<td  >PP008N</td>
<td width="50"   >00392605</td>
<td width="200"   >&#160;</td>
</tr>

<tr class="even "  onclick="ECSideUtil.selectRow(this,'ec');"  onmouseover="ECSideUtil.lightRow(this,'ec');"  onmouseout="ECSideUtil.unlightRow(this,'ec');"   >
<td width="50"   >4</td>
<td width="200"   >晓星</td>
<td  >BS035N</td>
<td width="50"   >00540578</td>
<td width="200"   >&#160;</td>
</tr>

<tr class="odd "  onclick="ECSideUtil.selectRow(this,'ec');"  onmouseover="ECSideUtil.lightRow(this,'ec');"  onmouseout="ECSideUtil.unlightRow(this,'ec');"   >
<td width="50"   >5</td>
<td width="200"   >晓峰</td>
<td  >P0206N</td>
<td width="50"   >00575083</td>
<td width="200"   >&#160;</td>
</tr>

<tr class="even "  onclick="ECSideUtil.selectRow(this,'ec');"  onmouseover="ECSideUtil.lightRow(this,'ec');"  onmouseout="ECSideUtil.unlightRow(this,'ec');"   >
<td width="50"   >6</td>
<td width="200"   >HYUNDAI INNOVATOR</td>
<td  >502W</td>
<td width="50"   >00000248</td>
<td width="200"   >&#160;</td>
</tr>

<tr class="odd "  onclick="ECSideUtil.selectRow(this,'ec');"  onmouseover="ECSideUtil.lightRow(this,'ec');"  onmouseout="ECSideUtil.unlightRow(this,'ec');"   >
<td width="50"   >7</td>
<td width="200"   >意珍</td>
<td  >6-029E</td>
<td width="50"   >01039709</td>
<td width="200"   >&#160;</td>
</tr>

<tr class="even "  onclick="ECSideUtil.selectRow(this,'ec');"  onmouseover="ECSideUtil.lightRow(this,'ec');"  onmouseout="ECSideUtil.unlightRow(this,'ec');"   >
<td width="50"   >8</td>
<td width="200"   >渣华香港</td>
<td  >42E26</td>
<td width="50"   >00019953</td>
<td width="200"   >&#160;</td>
</tr>

<tr class="odd "  onclick="ECSideUtil.selectRow(this,'ec');"  onmouseover="ECSideUtil.lightRow(this,'ec');"  onmouseout="ECSideUtil.unlightRow(this,'ec');"   >
<td width="50"   >9</td>
<td width="200"   >中海宁波</td>
<td  >0034E</td>
<td width="50"   >01415631</td>
<td width="200"   >&#160;</td>
</tr>

<tr class="even "  onclick="ECSideUtil.selectRow(this,'ec');"  onmouseover="ECSideUtil.lightRow(this,'ec');"  onmouseout="ECSideUtil.unlightRow(this,'ec');"   >
<td width="50"   >10</td>
<td width="200"   >YANG JIANG HE</td>
<td  >146N</td>
<td width="50"   >00502445</td>
<td width="200"   >&#160;</td>
</tr>

	</tbody>
</table><iframe style="border:0px;" marginwidth="0" marginheight="0" frameborder="0" border="0" width="0" height="0" id="ec_ecs_export_iframe" name="ec_ecs_export_iframe" ></iframe>
<div id="ec_toolbar"  class="toolbar"  style="width:100%;" >
	<table id="ec_toolbarTable"  class="toolbarTable"  cellpadding="0"  cellspacing="0" ><tr><td class="pageNavigationTool"  nowrap="nowrap" ><input type="button"  disabled="disabled"  class="pageNav firstPageD"  onclick="ECSideUtil.gotoPage(1,'ec');"  title="第一页" /><input type="button"  disabled="disabled"  class="pageNav prevPageD"  onclick="ECSideUtil.gotoPage(0,'ec');"  title="上一页"  disabled="disabled" /></td><td class="pageNavigationTool"  nowrap="nowrap" ><input type="button"  class="pageNav nextPage"  onclick="ECSideUtil.gotoPage(2,'ec');"  title="下一页" /><input type="button"  class="pageNav lastPage"  onclick="ECSideUtil.gotoPage(12,'ec');"  title="最末页" /></td>
<td class="separatorTool" >&#160;</td>
<td class="pageJumpTool"  nowrap="nowrap"  onmouseover="ECSideUtil.NearPagesBar.showMe(this,'ec');"  onmouseout="ECSideUtil.NearPagesBar.hideMe(this,'ec');" ><nobr><input type="button"  class="pageNav jumpPage"  onclick="ECSideUtil.gotoPageByInput(this,'ec');" /><input type="text"  name="ec_pg"  value="1"  class="jumpPageInput"  onkeydown="if (event.keyCode && event.keyCode==13 ) {ECSideUtil.gotoPageByInput(this,'ec');;return false; } " />/12页</nobr></td>
<td class="separatorTool" >&#160;</td>
<td class="pageSizeTool"  nowrap="nowrap" >每页<select name="ec_rd"  onchange="ECSideUtil.changeRowsDisplayed('ec',this);" >
				<option value="10"  selected="selected">10</option>
				</select>条</td>
<td class="separatorTool" >&#160;</td>
<td nowrap="nowrap"  class="refreshTool" ><nobr><input type="button"  class="toolButton girdRefresh"  onclick="ECSideUtil.reload('ec');" /></nobr></td>



<td class="separatorTool" >&#160;</td>
<td nowrap="nowrap"  class="exportTool" ><nobr></nobr></td>
<td class="separatorTool" >&#160;</td>
<td class="extendTool" ></td>
<td class="separatorTool" >&#160;</td>
<td nowrap="nowrap"  class="statusTool" ><nobr>共114条记录,显示1到10</nobr></td>
</tr>
	</table></div><div id="ec_toolbarShadow"  style="display:none;" ></div>
<!-- ECS_AJAX_ZONE_PREFIX_ _end_ec_ECS_AJAX_ZONE_SUFFIX -->
</div>
</form><div id="ec_waitingBar"  class="waitingBar" ></div><div id="ec_waitingBarCore"  class="waitingBarCore" ></div>
<script type="text/javascript" >
(function(){ 
 var gird=ECSideUtil.createGird('ec'); 
 gird.useAjax=true;  
 gird.doPreload=true; 
 gird.isClassic=true; 
})();
</script>


</body>
</html>


在页面最下方var gird=ECSideUtil.createGird('ec'); 这一句出现错误,js提示ECSideUtil未定义
sharong 2007-04-30
如果使用eXtremeComponents的标签,即在jsp页头写这个语句<%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>,出现下面的错误:
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: /demo/demoList.jsp(19,0) Attribute pageSizeList invalid for tag table according to TLD
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:234)
	org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:989)
	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
	org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
	org.apache.jasper.compiler.Node$Root.accept(Node.java:456)

... ...

在fins的demo程序democlassic.jsp中为什么没有报错?
fins 2007-04-30
第一个问题可能是编码原因
你的页面是GBK
我的ecside.js是UTF-8
你转换一下编码吧

下一版本我会提供多种编码的文件,大家在使用不同编码的时候引入不同的文件就可以了

第2个原因我也不太确定 能不能告诉我一下你的应用服务器是什么 谢谢
Global site tag (gtag.js) - Google Analytics