Front-End Code:
Passing values through AJAX, the return value of the Chinese garbled problem
$.ajax ({ URL:' buyercartmorehandle ', type:' post ', ' application/ x-www-form-urlencoded; Charset=utf-8 ", Data:param, dataType:' text ', success:function( Data) { alert (data); Window.location.reload (); } })
Back-end Code
@RequestMapping (value= "Buyercartmorehandle", method=requestmethod.post,produces={"text/html;charset=utf-8;", " Application/json; " }) @ResponseBody public String buyercartmorehandle (Model m, @RequestParam (value = " buyercartarray[] "string[] buyercartarray)//Pass the array in the form of a change parameter type, @requestParam (value=" ")
produces={"text/html;charset=utf-8;", "Application/json;"} Realize
}
Detailed reference:
Https://www.cnblogs.com/zique/p/6171862.html
Ajax using SPRINGMVC return value garbled problem