Solution 1:
When you pass the value to you, add a casual character to the back, and then use the substring to intercept the previous character. (Silly method)
Solution 2:
<Input type = "hidden" name = "" value = ""/> when passing a parameter in the shadow field on the page to the action, the passing value of this parameter does not seem to contain garbled characters.
Solution 3:
Configure Filter
Solution 4:
To transmit Chinese Characters in these two URLs, the url must be encoded and decoded.
Encoding: encodeURI ("string containing Chinese characters "))
Decoding: java.net. URLDecoder. decode ("the string to be decoded", "UTF-8 ");
Solution 5 (the most common solution ):
<Connector port = "8081" protocol = "HTTP/1.1"
ConnectionTimeout = "20000"
RedirectPort = "8443"
URLEncoding = "UTF-8"
/> Www.2cto.com
Server. xml configuration file in the tomcat conf folder
Add URLEncoding = "UTF-8"
You can implement unified character conversion to convert the default URL to unicode encoding.
Changed to UTF-8 encoding to solve the problem of Garbled text jump between Chinese pages.