JSP Chinese Coding Problem and Code Questions Some Information (Reprinted)

xiaoxiao2021-03-06  66

The final use of the code is: <% = new string (Rst.getstring (2) .getbytes ("ISO-8859-1"), "GB2312")%> Everyone often occurs in the development of JSP The problem may be a problem that I have plagued you, I now write the problem and solution of Chinese garbled in JSP development to you. First, the JSP page displays the display page below (Display.jsp), there is garbled: <% out.print ("JSP Chinese Processing");%> For different web servers and different JDK versions, the result is not same. Cause: The encoding method used by the server is different and the browser is caused by different characters display results. Solution: Specify the encoding mode (GB2312) in the JSP page, that is, the first line of the page plus: <% @ page contentType = "text / html; charset = GB2312"%> can eliminate garbled. The full page is as follows: <% @ Page ContentType = "text / html; charset = GB2312"%> <% out.print ("JSP Chinese Processing");%> Second, the form is messaging in Chinese, there is a commit page below (Submit.jsp), the code is as follows:

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

New Post(0)