我使用extdirectspring为我的 Spring MVC 应用程序设置了 ext direct 。我能够检索原语和字符串并在 ext.js 中使用它们。当我尝试检索对象列表时,我在 javascript 端得到“未定义”。我需要对 Person 类做些什么才能让它工作吗?
我注释了以下代码:
@ExtDirectMethod(ExtDirectMethodType.STORE_READ)
@Override
public Collection<Person> getPeople(String groupId) {
Group group = GroupManager.getGroup(groupId);
return group.getPeopleList();
}
这是我在客户端使用的:
directory.getPeople(id, function(result) {
console.log(result);
});
这是 app.js 的样子:
Ext.ns('Ext.app');
Ext.app.REMOTING_API = {
"actions":{
"directory":[{
"name":"getID","len":0
},{
"name":"getPeople","len":1
}
]},
"type":"remoting",
"url":"/test/action/router"
};