Today when writing a JSP page, found the following error:
<span style= "FONT-SIZE:18PX;" > <a href= "request.jsp?username= small 77" > Test URL Parameters </a></span>
In general, by using ContentType and the following can be used to solve the problem of Chinese characters in the transfer process, but it seems that the URL of the parameter to the device and other things.
<% request.setcharacterencoding ("Utf-8"); To solve the problem of Chinese garbled %>
Checked, and found that if you run the URL, you need to set the following in the server:
<connector port= "8088" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443" URIEncoding= "Utf-8 "/>
You can avoid garbled characters in URL arguments by adding the uriencoding attribute to the connector.
Configure Tomcat to solve the problem of Chinese garbled characters from URL communication