[列表组件] webwork+ecside有没有例子,分页问题

zhanghui 2007-10-25
用webwork+ecside能显示当前数据 不能分页

我把问题代码列出来大家帮我看看
userAction.java

    public class userAction extends ActionSupport {
//默认每页显示的记录条数
private static int DEFAULT_PAGE_SIZE = 20;
       /**
* 列表
* @return
* @throws Exception
*/
@SuppressWarnings("static-access")
public String list() throws Exception{
getRequest().setAttribute("recordList",
           jdbcTemplateDao.querySQL("SELECT * FROM USER_INFO WHERE 1=1"));        return this.LIST;
}

/**
* Convenience method to get the request
* @return current request
*/
public HttpServletRequest getRequest() {
    return ServletActionContext.getRequest();
}
}

userList.jsp

<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://www.ecside.org" prefix="ec" %>
<html>
<head>
<jsp:include page="common_head.jsp" flush="true" />
</head>
<body style="margin:10px;" >
<ec:table items="recordList" var="record" retrieveRowsCallback="limit"
action="${pageContext.request.contextPath}/user/userList.action"
title="用户列表"
xlsFileName="用户列表.xls"
csvFileName="用户列表.csv"
width="100%"
listWidth="100%"
height="280px"
>
<ec:row>
<ec:column width="50" property="_0" title="序号"
value="${GLOBALROWCOUNT}" />
<ec:column width="80" property="USERROLE" title="角色"/>
<ec:column width="120" property="USERNAME" title="用户名" />
<ec:column width="100" property="PASSWD" title="密码"  />
<ec:column width="120" property="EMAIL" title="电子信箱" />
<ec:column width="70" property="GENDER" title="性别"/>
</ec:row>
</ec:table>
</body>
</html>

xwork.xml

<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.1.1//EN" "http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">
<xwork>
<package name="user" namespace="/user" extends="default">
<action name="userList" class="com.rich.demo.user.action.UserAction"
method="list">
<result name="list">/biz/demo/user/UserList.jsp</result>
</action>
</package>
</xwork>
王牌海盗 2007-11-12
我在struts+ecside下也出现这个分页问题,困扰了好久也没解决。希望各位能指导下。
代码及原帖:http://ecside.group.iteye.com/group/blog/135597
shithanwa 2007-11-30
我也是刚搞webwork,现在也准备学ECSide...貌似分页没有问题。
rubin 2008-05-03
在web.xml加入过滤器即可,具体实现如下:
<filter>
...(自己系统的过滤器)...
</filter>

<!-- 新加的过滤器 -->
<filter>
<filter-name>eXtremeExport</filter-name>
<filter-class>org.ecside.filter.ECSideFilter</filter-class>
<init-param>
<param-name>responseHeadersSetBeforeDoFilter</param-name>
<param-value>false</param-value>
</init-param>
</filter>



<filter-mapping>
...(自己系统的过滤器mapping)...
</filter-mapping>

<!-- 新加的过滤器mapping -->
<filter-mapping>
<filter-name>eXtremeExport</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
cats_tiger 2008-05-04
貌似没有把总记录行数放到request中
Global site tag (gtag.js) - Google Analytics