Springmvc Troubleshooting Get method Request garbled < ALL Help >

Source: Internet
Author: User

01-"Ideas"

As we all know, if the request of post can be configured in Web. XML org.springframework.web.filter.CharacterEncodingFilter way to solve the garbled problem,

But the Get method has to request that the filter is not set to the desired encoding. Only get the request path to think about how to solve the coding problem.

02-"Workaround 01-Code Resolution"

String Des=new string (testname.getbytes ("Iso-8858-1"), "Utf-8");

TestName: Incoming Get parameters

Des: Converts the encoded value

03-"Workaround 02-Set the server request encoding method"

Take Tomcat for example:

Set conf/server.xml-

<connector port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
redirectport= "8443"/>

Change to------->

<connector port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
Redirectport= "8443" uriencoding= "UTF-8" />

Springmvc Troubleshooting Get method Request garbled < ALL Help >

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.