javascript - 通過a標(biāo)簽href屬性跳轉(zhuǎn)后臺亂碼問題
問題描述
通過a標(biāo)簽href屬性跳轉(zhuǎn)后臺亂碼問題,試過request.setCharacterEncoding('UTF-8');設(shè)置,沒有用。
頁面代碼
<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');//也實(shí)現(xiàn)不了 System.out.println(request.getParameter('title_type'));//輸出 qtListType3=qtbiz.findTypeTitle(request.getParameter('title_type')); request.getSession().setAttribute('qtListType3', qtListType3);return 'problem-more'; }
想問問還有沒有其他方法實(shí)現(xiàn),解決亂碼問題
問題解答
回答1:title_type包含中文嗎?參考【W(wǎng)EB】url路徑包含中文和表單get請求包含中文
回答2:需要對 中文進(jìn)行轉(zhuǎn)碼
相關(guān)文章:
1. docker 下面創(chuàng)建的IMAGE 他們的 ID 一樣?這個是怎么回事????2. html5和Flash對抗是什么情況?3. docker 17.03 怎么配置 registry mirror ?4. html5 - datatables 加載不出來數(shù)據(jù)。5. 運(yùn)行python程序時出現(xiàn)“應(yīng)用程序發(fā)生異常”的內(nèi)存錯誤?6. node.js - mongodb查找子對象的名稱為某個值的對象的方法7. 測試自動化html元素選擇器元素ID或DataAttribute [關(guān)閉]8. javascript - QQ第三方登錄的問題9. spring-mvc - spring-session-redis HttpSessionListener失效10. javascript - 在 model里定義的 引用表模型時,model為undefined。

網(wǎng)公網(wǎng)安備