I upgraded my Web application from tomcat5.0.30 to 5.5.26, found that the static text of the page is normal, but the page input box input in Chinese, in the background of the action layer check found that Chinese into garbled, in the action of the 5.5.26 environment using the following statement test:
System.out.println (New String (Scode.getbytes ("iso-8859-1"), "GBK");
Discovery can be converted to Chinese, indicating that the 5.5.26 environment of the page input box character set for Iso-8859-1, in the 5.0.30 environment such conversion is garbled, the Description 5.0.30 The character set of the page input box is GBK, and I have <%@ page on my pages. Contenttype= "text/html; CHARSET=GBK "%>,
And in the Web.xml also configured GBK character set filter, then why go from 5.0.30 to 5.5.26, the page input box to enter the Chinese will be iso-8859-1, and the other text on the page is normal, and then online check, in the tomcat5.5.26 conf/ Server.xml in the connector tag plus uriencoding= "GBK", garbled problem disappeared, see below:
<connector port= "8080" maxhttpheadersize= "8192"
maxthreads= "minsparethreads=" maxsparethreads= "75"
Enablelookups= "false" redirectport= "8443" acceptcount= "100"
connectiontimeout= "20000" disableuploadtimeout= "true" uriencoding= "GBK"/>
Description: There are several connector, note that this specifies the Tomcat run port.
Later compared the configuration of 5.0.30, found that 5.0.30 Server.xml also set uriencoding= "GBK", only to upgrade Tomcat did not pay attention to it.