Methods to solve the Chinese garbled return value of java's ajax submission: 1. Add code [products=text/html;charset=UTF-8] to the concurrent configuration of RequestMapping; 2. In the file [mvc: annotation-driven] Add code.
[Related article recommendations:ajax video tutorial]
Solution to java's ajax submission return value in Chinese Methods for garbled characters:
1. It is determined (as a result of many tests) that Chinese garbled characters will only appear when the return value is String, and when the return value isMap06aeaed652f099bdd7b965333c229a74
or other types, no Chinese garbled characters appear.
2. Add
products="text/html;charset=UTF-8"
to the concurrent configuration of @RequestMapping to solve the problem
3, or add
text/html;charset=UTF-8 application/json;charset=UTF-8 */*;charset=UTF-8
to mvc:annotation-driven in the configuration file. Related learning recommendations:java basic tutorial
The above is the detailed content of What should I do if the return value of Java's ajax submission is Chinese garbled?. For more information, please follow other related articles on the PHP Chinese website!