如果我输入密码为Admin$&%^
orAdmin$&^%
然后我的 ajax 调用有效,但如果我输入它这样
Admin$!%
or Admin$!%^
。ajax 调用引发以下异常.....
请帮助,因为我无法找到此问题的根本原因
INFO: Character decoding failed. Parameter [txt_password] with value [Admin$!%] has been ignored. No
te that the name and value quoted here may be corrupted due to the failed decoding. Use debug level
logging to see the original, non-corrupted values.
java.io.CharConversionException: EOF
at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:80)
at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:46)
at org.apache.tomcat.util.http.Parameters.urlDecode(Parameters.java:410)
at org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:370)
at org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:217)
at org.apache.catalina.connector.Request.parseParameters(Request.java:2647)
at org.apache.catalina.connector.Request.getParameter(Request.java:1106)
at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:355)
at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:158)
在探索时我发现:
Special characters are not allowed inside the query string. They must be replaced by a "%" followed by the ASCII code in Hex. E.g., "~" is replaced by "%7E", "#" by "%23" and so on. Since blank is rather common, it can be replaced by either "%20" or "+" (the "+" character must be replaced by "%2B"). This replacement process is called URL-encoding, and the result is a URL-encoded query string.
那么这是否意味着我们不能在输入字段中使用 % 作为值?