将表格数据从extjs4.2发布到Spring Controller

时间:2013-09-27 07:03:33

标签: spring-mvc extjs extjs4.2

这是我的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";

    }

0 个答案:

没有答案