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']="[email protected]";
vendor['emails[0].flags']=3;
vendor['emails[1].emailAddress']="[email protected]";
vendor['emails[1].flags']=3;

:)

猜你喜欢

转载自sunzeping.iteye.com/blog/2288373