Home >Java >JavaBase >Java garbled question mark solution

Java garbled question mark solution

尚
Original
2019-12-17 16:06:404176browse

Java garbled question mark solution

java garbled question marks are as shown below:

Java garbled question mark solutionEverything involving Chinese characters has turned into a question mark, which is very strange. It is an international practice, starting from the html page Check,

Java garbled question mark solutionIt seems that the encoding is OK, and the Chinese characters in other modules of the page can be displayed normally, so I start to conclude that it is a background problem. Start looking at the action, and check the request and response. Set the encoding format to utf-8. After restarting the project, I found that it was still garbled.

Look at the code of my controller below:

Java garbled question mark solution

The return value of service is as follows:

Java garbled question mark solutionThe background returns a json object , and what I passed to the front desk was of type string, so the problem occurred here. After changing the return value to a json object, everything went fine.

For more java knowledge, please pay attention to the java basic tutorial column.

The above is the detailed content of Java garbled question mark solution. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn