Tomcat GET request Chinese garbled

Source: Internet
Author: User

TOMCAT7, the get data is guaranteed to be UTF8 encoded, and the following settings are made in Server.xml:

Add: uriencoding= "UTF-8"


<connector port= "8080" maxthreads= "minsparethreads= "
maxsparethreads= "enablelookups=" false "redirectport=" 8443 "
acceptcount= "debug=" connectiontimeout= "20000"
disableuploadtimeout= "true" uriencoding= "UTF-8"/>

Specifies the data encoding for the get time. This setting is invalidated when using IIS to forward servlet/jsp requests to Tomcat as webserver

The reason is simple: IIS forwards the request to the Tomcat listener on Port 8009 via the AJP protocol, so this setting for 8080 is naturally invalid.


The correct approach is to make the following settings:

<connector port= "8009" enablelookups= "false" redirectport= "8443"
debug= "0" protocol= "ajp/1.3" uriencoding= "UTF-8"/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/CE/wKiom1YprDWRXD0TAAB4zavuxlw499.jpg "title=" WBN%DW _ ' 7) N ' 9]p (4j]{5qd.png "alt=" Wkiom1yprdwrxd0taab4zavuxlw499.jpg "/>


Extended:


8080 Port, which is responsible for establishing an HTTP connection. This connector is used when accessing a web App for a tomcat server through a browser.

Port 8009, which is responsible for establishing connections to other HTTP servers. When you integrate Tomcat with other HTTP servers, you need to use this connector.


With validation tests, this method is equally valid for requests that occur on a Tomcat server deployed on Linux.


Site Link: http://blog.csdn.net/zelda002/article/details/8013402

Tomcat GET request Chinese garbled

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.