今天作分頁功能遇到這樣子的問題:java
表單用get方法傳含有"%"字符參數,返回頁面的連接中包含該參數,點擊該連接出現:apache
org.apache.tomcat.util.http.Parameters processParameters
Warning: Parameters: Character decoding failed. Parameter skipped.
java.io.CharConversionException: EOFtomcat
當get方式提交表單時 "%"會被轉換成"%25",而在把參數寫回頁面的連接時,並無作相關的encode.url
另外發現Firefox和IE的狀態欄顯示的url有點不一樣:code
在Firefox中,狀態欄提示的url是否是a標籤中href的字面值,應該經decode過的url,
而在IE中,狀態欄提示的就是a標籤中href的字面值。
如一樣的 <a href="http://localhost:8080/a/action.do?name=%251&p=2">test encoding</a>
在FireFox的狀態欄顯示的是: http://localhost:8080/a/action.do?name=%1&p=2,
在IE中是:http://localhost:8080/a/action.do?name=%251&p=2
固然,點擊該連接,地址欄中的地址都就是http://localhost:8080/a/action.do?name=%251&p=2同樣的了。ip