The problem of response.sendredirect () characters garbled in web programming

Source: Internet
Author: User
The problem of response.sendredirect () characters garbled in web programming

Today, I encountered a Web project in the Response.sendredirect () in a severlet to another severlet jump and the parameter will be garbled Chinese characters problem. Later on the Internet to find a solution, is to pass the Chinese character coding when the communication:

Name=java.net.urlencoder.encode (rs.getstring ("bname"), "UTF-8");//encode Chinese as UTF-8

I need to Chinese character coding for UTF-8, depending on the project code, jump and pass the parameters:

String url= "Showgoods?name=" +name;
Response.sendredirect (URL);

Receive parameters:

String username=request.getparameter ("name");

At this point, the perfect solution garbled.
Original method Source: http://m.ithao123.cn/content-9818244.html

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.