javascript - 通過a標簽href屬性跳轉后臺亂碼問題
問題描述
通過a標簽href屬性跳轉后臺亂碼問題,試過request.setCharacterEncoding('UTF-8');設置,沒有用。
頁面代碼
<p class='extra'> <a target='_blank' href='http://www.leifengta.com.cn/wenda/Qtitle/findTypeTitle?title_type=${qtype.title_type}'>查看更多>></a></p>
后臺代碼
@RequestMapping('/findTypeTitle')public String findTypeTitle(Model model,String title_type) throws UnsupportedEncodingException{ request.setCharacterEncoding('UTF-8'); //response.setContentType('text/html; charset=utf-8');//也實現不了 System.out.println(request.getParameter('title_type'));//輸出 qtListType3=qtbiz.findTypeTitle(request.getParameter('title_type')); request.getSession().setAttribute('qtListType3', qtListType3);return 'problem-more'; }
想問問還有沒有其他方法實現,解決亂碼問題
問題解答
回答1:title_type包含中文嗎?參考【WEB】url路徑包含中文和表單get請求包含中文
回答2:需要對 中文進行轉碼
相關文章:
1. boot2docker無法啟動2. node.js - antdesign怎么集合react-redux對input控件進行初始化賦值3. 老師,按tab鍵不起作用怎么回事4. 關于docker下的nginx壓力測試5. 您好師太我想請教這個框架怎么搭建呢?6. javascript - 在低版本微信如何處理引用高版本的微信小程序基礎庫所帶來的問題?7. python2.7 - Python安裝模組不成功8. python - for循環print怎樣才能輸出csv呢9. angular.js - Angular開發的單頁面應用,如何正確地實現在微信里的網頁授權和調用js sdk10. mysql - InnoDB中的鎖

網公網安備