The jsp page garbled in a daily article
Based on the causes of Chinese Garbled text, there are mainly the following solutions:
1. When the form data submitted using the Post method contains Chinese characters.
In this way, you can call the setCharacterEncoding ("") method of the request object to set the request decoding method to the UTF-8 before obtaining the request parameter value. Like this:
2. When the form data submitted using the GET method contains Chinese characters.
Because the data we submit is appended to the end of the URL as a query string and sent to the server, the setCharacterEncoding () method called on the server does not work for this part of data, after obtaining the request parameter value, encode and convert it. Like this:
3. Set the contentType attribute of the page command directly through the JSP page to specify the encoding format of the page content, as shown in the following code: