function Send () { var users=[1000000013810001001]; var data={ users:users, flag:true }; var address= "192.168.30.237:10101"; Alert (json.stringify (data)); $.ajax ({ URL: "<%=request.getcontextpath ()%>/api/commandkey/chat_block", type: "Post", DataType: "JSON", data:{"params": json.stringify (data), "Address": Address}, success:function (data) { Alert (json.stringify (data)); } )
Code as above
Backstage I use directly
Jsonobject Jo = Jsonobject.fromobject (jsonstr); Userstatusvo vo = null; Vo = (USERSTATUSVO) Jo.tobean (Jo, Userstatusvo.class);
Backstage I directly converted to Java objects with JSON characters, and later found that I can not send users to prohibit the message
I also to why serialization problem, tangled for a long time, consumed me half a day
The back compares the numbers passed over and compares them carefully.
Browser start value: 1000000013810001001<pre name= "code" class= "JavaScript" ><pre name= "code" class= "JavaScript" > The browser passed the value: 100000001381000100<span style= "color: #FF0000;" ><span style= "Background-color:rgb (255, 0, 0); >0</span></span>
Fuck, I was so angry.
JS Object uses Json.stringify (); method numbers are lost by a 1
Too dog blood, I hope you pay special attention in the future
Finally, I'll just change it to a string and it's OK.
<pre name= "Code" class= "JavaScript" >var users=["1000000013810001001"]
JS number is too long cause the front and back number is not the same (really JS a big pit)