我试图在 ExtJS 和 Java 之间进行通信我正在将请求从 ExtJS 发送到使用 netty 的 Java 服务器。如果有人可以向我发送一个示例,说明如何从 java 端格式化响应以及如何从 ExtJS 端读取响应数据,我会提前感谢。这是我在 ExtJS 方面的来源
var store = new Ext.data.JsonStore({
autoload: true,
baseParams: {
conid : '6b09477f-aa04-4f5a-b969-05277d01f07e'
},
root: 'OpenCashTime',
proxy: new Ext.data.ScriptTagProxy({
url: 'http://localhost:8080/getOpenCash?'
}),
fields: [{name: 'Time', mapping: 'Time', type: 'int'}]
});
store.load();
store.on('load', function() {
alert(store.getTotalCount());
});
store.on('write', function() {
alert(store.getTotalCount());
});
store.on('loadexception', function() {
alert("AAAAAA");
});
store.on('metachange', function() {
//alert(store.getTotalCount());
});
store.on('update', function() {
//alert(store.getTotalCount());
});
store.on('save', function() {
//alert(store.getTotalCount());
});
store.on('datachanged', function() {
//alert(store.getTotalCount());
});
执行此代码并接收此响应时 {"OpenCashTime":[{"Time":1291623637000},{"Time":1294914317000}]} 尽管即使萤火虫看到它的 Json,但我仍然收到 loadexception