这是我的extjs 4.2.1数据存储:
Ext.define('APP.store.CompanyStore', {
extend : 'Ext.data.Store',
requires: 'APP.model.Company',
model : 'APP.model.Company',
proxy: {
type : 'ajax',
url : 'searchP.html',
actionMethods :{read:'POST'},
reader : {
type: 'json',
root: 'items'
}
}
以下是我对提交的行动:
var pname = Ext.getCmp('pname ').getValue();
var SearchObj = Ext.getCmp('searchForm').getValues();
SearchObj.pname =pname;
var store = Ext.getStore('APP.store.CompanyStore');
store.load({
params:{
"SearchObj" :Ext.encode(SearchObj)
},
callback: function(records, operation, success) {
// the operation object
// contains all of the details of the load operation
console.log(records);
}
});
我的问题:
对象未映射到我的Spring控制器中服务器端定义的POJO。可能是什么问题。
我的春季控制器:
@RequestMapping(value = "/searchP", method = RequestMethod.POST)
public @ResponseBody String searchP(@RequestBody Company company){
System.out.println("pname"+company.getPName()); //getting null.Not getting actual value.
return "item";
}