ext getCount()=0 得不到返回json数据

萧君 2013-03-28 05:52:00
public String findAll() {
System.out.println("----------------findAll()-----------");
listmap=(List)biz.findAll();
System.out.println("listmap()---->"+listmap.size());
return null;
}

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="emp_struts" namespace="/" extends="json-default">
<action name="findAll" class="EmpAction" method="findAll">
<result type="json">
<param name="includeProperties">listmap</param>
</result>
</action>
</package>
</struts>


var _jsonReader = new Ext.data.JsonReader( {
root : 'listmap',
id : 'eid'
}, new Ext.data.Record.create( [ {
name : 'eid'
}, {
name : 'ename'
}, {
name : 'passwd'
} ]));
var ds = new Ext.data.Store( {
proxy : new Ext.data.HttpProxy( {
method : 'POST',
url : 'findAll.action'
}),
reader : _jsonReader

});
ds.load({
callback:function(){
alert(ds.getCount());
}
});
...全文
121 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
萧君 2013-03-28
  • 打赏
  • 举报
回复
上面后台方法 struts2配置文件 js中ext代码 后台可以查到数据库listmap里有数据 传到前台store getCount()为0 大神帮指点哈 哪有问题!!!

23,407

社区成员

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

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