jsp:
<table class="easyui-datagrid" title="Basic DataGrid"
style="width: 700px; height: 250px"
data-options="singleSelect:true,fitColumns:true,url:'easyui2.do',rownumbers:true,
autoRowHeight:false,pagination:true,pageSize:10">
<thead>
<tr>
<th data-options="field:'userId',width:80">编号</th>
<th data-options="field:'userName',width:100">用户名</th>
<th data-options="field:'gender',width:80,align:'right'">性别</th>
<th data-options="field:'password',width:80,align:'right'">密码</th>
<th data-options="field:'isExpire',width:250">超期</th>
<th data-options="field:'status',width:60,align:'center'">登陆状态</th>
<th data-options="field:'sessionid',width:60,align:'center'">会话id</th>
</tr>
</thead>
</table>
action:
private JSONObject result;
public JSONObject getResult() {
return result;
}
public String easyui2() {
HttpServletRequest request = ServletActionContext.getRequest();
Map map = new HashMap();
map.put("userId", "");
map.put("userName", "");
PagerTag pageResult = userService.queryByPage(1, 10, map);
List<TblSysUser> userlist= pageResult.getResult();
List beanList = new ArrayList();
for(TblSysUser user:userlist){
UserBean ubBean = new UserBean();
BeanUtils.copyProperties(user, ubBean);
beanList.add(ubBean);
}
Map<String, Object> obj = new HashMap<String, Object>();
obj.put("total", pageResult.getRecordCount());
obj.put("rows", beanList);
result=JSONObject.fromObject(obj);
return SUCCESS;
}
struts:
<constant name="struts.action.extension" value="do" />
<package name="system" extends="struts-default,json-default">
<action name="easyui2" class="com.book.ssh.action.UserManageAction"
method="easyui2">
<result type="json">
<param name="root">result</param>
</result>
</action>
结果:

------解决思路----------------------
是直接显示了json而没有渲染表格?