Home> Java> JavaBase> body text

Java garbled question mark solution

Release: 2019-12-17 16:06:40
Original
4044 people have browsed it

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 thejava basic tutorialcolumn.

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!