Jsp request. getparameter () garbled

Source: Internet
Author: User
 
Recently I encountered a request. getparameter garbled problem. If it is post, you can set the filter method to solve it. If it is a get or hyperlink, it was previously set by setting the tomcat configuration file server. XML to solve, but this is not good, not all projects, we can modify the tomcat configuration file on the server. DetailsCodeAs follows:
1: Connector Port = "8080" maxhttpheadersize = "8192" 2: maxthreads = "150" minsparethreads = "25" maxsparethreads = "75" 3: enablelookups = "false" redirectport = "8443" acceptcount = "100" 4: connectiontimeout = "20000" disableuploadtimeout = "true" uriencoding = "GBK"/>

Servlet:

String bz_name = new string (request. getparameter ("bz_name "). getbytes ("ISO8859-1"), "UTF-8"); system. out. println ("request. getparameter (bz_name ). trim (): "+ bz_name); Request. setattribute ("bz_name", bz_name );

Related Article

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.