[需求:
     1.页面所有表单上具体业务数据封装成json对象通过ajax异步请求发送到后台Action!
     2.具体操作指令封装成另外一个json对象发送到后台ActionSimpleAction中定义了如下对象用于具体操作
/**
 * 存放业务数据
 */
protected Map<String, Object> serviceData = new HashMap<String, Object>();
/**
 * 存放指令数据
 */
protected Map<String, Object> opData = new HashMap<String, Object>();
业务数据可能有多个对象如 User , Order对象,处于同一个form表单显示
指令数据是在页面上定义的
var pageMetaData = {
ServiceClassName:"service.test.userService",//业务层对应的服务类
          DaoClassName:"dao.test.userMapper",//数据层对应的操作类
          EchoCheck: "",
 opType:"save",
                    handerName:"UserHander" 
  };
我的做法是这样的
var bizdate = form.serialize();
var operationDate = pageMetaData;
function ajaxRequest(url,bizdate,
operationDate ,callbackFun) {
$.ajax({
url : url,
// 数据发送方式
type : "post",
// 接受数据格式
dataType : "json",
// 要传递的数据
data :{'bizdate':bizdate,'oprationDate':oprationDate},
// 回传函数
//success : function(result) {
success : function() {
alert('请求成功');
},
//失败
failure : function(result) {
}
});
}
但是传输的数据是这样的bizdate                              user.GuId=&user.userName=543&user.age=234
operationDate[DaoClassName]           com.yum.boh.fund.dao.test.userMapper
operationDate[EchoCheck]
operationDate[opType]           Save
operationDate[ServiceClassName] com.yum.boh.fund.service.test.userService
这样的数据在后台如何放到我在action中定义的那两个map里去呢?我想要的是 bizdate里 name=User,value=new User();表单所有的对象都这样封装进bizdate里。
           operationDate里 ServiceClassName = ***, daoClassName = ***, handerName=***,isCallBack=***,behavier="save", and so on.!
求大神赐教~~~~