1. 程式人生 > >使用springmvc redirect跳轉地址時中文引數為空

使用springmvc redirect跳轉地址時中文引數為空

在本地環境測試時使用jetty容器能正常收發url中文引數的值,但在線上tomcat容器環境時,無法正確獲取url中文引數的值
日誌中中提示以下記錄:
Character decoding failed. Parameter [name] with value [%u6d4b%u8bd5] has been ignored. Note 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.

解決思路:
對中文傳值時需要先對中文進行兩次URL編碼,在接收時再進行一次URL解碼即可