Tomcat4.1.29 Chinese display garbled solution

xiaoxiao2021-03-20  217

Recently encountered Tomcat4.1.29 Chinese display garbled, solution

For JSP:

method 1.

Change the Default Charset in Tomcat to you, then recompile Tomcat code. Method 2. Add to the file header

<% @ Page ContentType = "text / html" PageEncoding = 'GB2312'%>

Or <% @ Page ContentType = "text / html; charset = GB2312"%>

Add:

<% Request.SetCharacterencoding ("GBK");%>

For HTM:

Plus in tomcat_home / conf / web.xml

htm

text / html; charSet = GB2312

HTML

text / html; charSet = GB2312

In order to make the default JSP can add the code with GB2312 encoding method

JSP

org.apache.jasper.servlet.jspservlet

logverbositylevel

Warning

fork

false

javaEncoding

GB2312

3

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

New Post(0)