org.apache.tomcat.util.http.Parameters processParameters 警告: Parameters: Charac
异常与提示:2009-9-19 7:49:54 org.apache.tomcat.util.http.Parameters processParameters
警告: Parameters: Character decoding failed. Parameter skipped.
java.io.CharConversionException: isHexDigit
WARN URL:206 - Unable to put request parameters (id=%{blogPassageId}) into parameter map.
java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "{b"
WARN URL:206 - Unable to put request parameters (id=%{blogPassageId}) into parameter map.
java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "{b"
异常环境:
2个ACTION:
第1个:
<action name="LoadBolgPassageById-*" class="BlogPassageAction" method="loadBolgPassageById">
第2个:
<result type="redirect">LoadBolgPassageById.action?id=%{blogPassageId}</result>
第2个负责往第一个ACTION里传值,第一次写成这样:
<result type="redirect">LoadBolgPassageById.action?id=%{blogPassageId}</result>
就会出先类型转换上的错误。在ACTION里改GET属性也不行。还是报异常。
解决方法:
最后直接把第2个ACTION里的传值符号改了改成($):
<param name="blogPassageId">${blogPassageId}</param>
<result type="redirect">LoadBolgPassageById.action?id=${blogPassageId}</result>
注意了,blogPassageId这个属性也要加以说明哦,${blogPassageId},不然传值回退会出现逻辑BUG。
最后的问题,由于直接传了$参数,导致之后的ACTION总会跟上这个$值,如果你传成这样:
LoadBolgPassageById.action?id=1-id=${x}
之后,后面传入的${x}值总会把前面的id=1值给覆盖掉,所以后面的参数名跟之前的参数名需要不同,这样就OK了,这个破BUG。
搞定。
总结:
问题还是出在类型的转换上,%传入的值只存在一次,$传入的值长期存在。
页:
[1]