Tomcat文字化け対策

Tomcat5.Xでは、GETのvalue、FORMのactionにgetを使用した際に、文字化けが発生する。
この文字化けへの対策としては、server.xmlに以下のパラメータ値をセットする。


useBodyEncodingForURI="true"
下記に設定例を示す(以下はHTTPポートへの設定)。



This specifies if the encoding specified in contentType should be used for URI query parameters,
instead of using the URIEncoding. This setting is present for compatibility with Tomcat 4.1.x,
where the encoding specified in the contentType, or explicitely set using
Request.setCharacterEncoding method was also used for the parameters from the URL.
The default value is false.

Tomcat4.1.x系との互換性の為に使用される。デフォルトはfalseだが、互換を保つにはtrueを指定する。trueにすると、ContentType又はRequest.setCharacterEncodingメソッドで指定されたエンコーディングをデコードに使用する。URIEncodingは使われない。