1

Admin$&%^パスワードをorとして入力するとAdmin$&^%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. 

それは、入力フィールドの値として % を使用できないということですか?

4

2 に答える 2

1

ついに解決策を得ました、

クエリ文字列にパラメータを追加する前に、javascriptのencodeURIComponent関数を使用しました。W3Schoolsから

The encodeURI() function is used to encode a URI.
This function encodes special characters, except: , / ? : @ & = + $ # (Use encodeURIComponent() to encode these characters).

Tip: Use the decodeURI() function to decode an encoded URI.
于 2013-02-25T08:35:00.243 に答える
1

前の手順で既に URL デコードされた文字列を URL デコードしようとしています。それがあなたの根本原因です。

検証された文字列と無効化された文字列の 2 つのセットの違いは、「&」文字です。アンパサンドを使用したものが検証される理由が正確にはわかりません...「&」がセパレーターと見なされるため、「%」に到達する前にパーサーが停止する可能性があります。

于 2013-02-21T15:43:42.037 に答える