javascript - 通過a標簽href屬性跳轉(zhuǎn)后臺亂碼問題
問題描述
通過a標簽href屬性跳轉(zhuǎn)后臺亂碼問題,試過request.setCharacterEncoding('UTF-8');設(shè)置,沒有用。
頁面代碼
<p class='extra'> <a target='_blank' href='http://www.cgvv.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');//也實現(xiàn)不了 System.out.println(request.getParameter('title_type'));//輸出 qtListType3=qtbiz.findTypeTitle(request.getParameter('title_type')); request.getSession().setAttribute('qtListType3', qtListType3);return 'problem-more'; }
想問問還有沒有其他方法實現(xiàn),解決亂碼問題
問題解答
回答1:title_type包含中文嗎?參考【W(wǎng)EB】url路徑包含中文和表單get請求包含中文
回答2:需要對 中文進行轉(zhuǎn)碼
相關(guān)文章:
1. android - webview 自定義加載進度條2. 為什么我ping不通我的docker容器呢???3. javascript - 微信小程序限制加載個數(shù)4. 并發(fā)模型 - python將進程池放在裝飾器里為什么不生效也沒報錯5. mysql - 怎么讓 SELECT 1+null 等于 16. python 怎樣用pickle保存類的實例?7. linux - openSUSE 上,如何使用 QQ?8. 大家好,請問在python腳本中怎么用virtualenv激活指定的環(huán)境?9. linux - 升級到Python3.6后GDB無法正常運行?10. Python中, 仿照經(jīng)典代碼實現(xiàn)單例, 卻出現(xiàn)了不是單例的的狀態(tài), 代碼哪里出錯了 ?
