property referenced in indexed property path is neither an array nor a list nor

http://stackoverflow.com/questions/5900840/post-nested-object-to-spring-mvc-controller-using-json

 

http://www.bmchild.com/2014/02/spring-mvc-3-property-referenced-in.html

 

 

(function($){// copy from jquery.jsvar r20 =/%20/g,
  rbracket =/\[\]$/;

  $.extend({
    customParam:function( a ){var s =[],
        add =function( key, value ){// If value is a function, invoke it and return its value
          value = jQuery.isFunction( value )? value(): value;
          s[ s.length ]= encodeURIComponent( key )+"="+ encodeURIComponent( value );};// If an array was passed in, assume that it is an array of form elements.if( jQuery.isArray( a )||( a.jquery &&!jQuery.isPlainObject( a ))){// Serialize the form elements
        jQuery.each( a,function(){
          add(this.name,this.value );});}else{for(var prefix in a ){
          buildParams( prefix, a[ prefix ], add );}}// Return the resulting serializationreturn s.join("&").replace( r20,"+");}});/* private method*/function buildParams( prefix, obj, add ){if( jQuery.isArray( obj )){// Serialize array item.
    jQuery.each( obj,function( i, v ){if(rbracket.test( prefix )){// Treat each array item as a scalar.
        add( prefix, v );}else{
        buildParams( prefix +"["+(typeof v ==="object"|| jQuery.isArray(v)? i :"")+"]", v, add );}});}elseif(obj !=null&&typeof obj ==="object"){// Serialize object item.for(var name in obj ){
      buildParams( prefix +"."+ name, obj[ name ], add );}}else{// Serialize scalar item.
    add( prefix, obj );}};})(jQuery);



You can try something like this:

vendor['emails[0].emailAddress']="abc123@abc.com";
vendor['emails[0].flags']=3;
vendor['emails[1].emailAddress']="xyz@abc.com";
vendor['emails[1].flags']=3;

:)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值