JSP Chinese Show tips

xiaoxiao2021-03-06  101

The programmer who just started to learn JSP will encounter such a problem, which is the Chinese unable to display. Most of the websites are in the general website: add the following code to the web page: <% @ page contenttype = "Text / HTML; CHARSET = GB2312 "%> But this is often just the text on the page can be displayed normally, but the Chinese submitted through the form still cannot be displayed.

Two methods have been supported in the current JSP & Servlet, so the solution is to join the two lines of code in each page: response.setContentType ("text / html; charset = GB2312"); Request.SetCharacterencoding ("GB2312); pass This kind of method, whether it is a form or a web page, can be displayed normally!

转载请注明原文地址:https://www.9cbs.com/read-126877.html

New Post(0)