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://m.4tl426be.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:需要對 中文進(jìn)行轉(zhuǎn)碼
相關(guān)文章:
1. python執(zhí)行cmd命令,怎么讓他執(zhí)行類似Ctrl+C效果將其結(jié)束命令?2. python - Flask寫的注冊頁面,當(dāng)注冊時,如果填寫數(shù)據(jù)庫里有的相同數(shù)據(jù),就報錯3. python - Django有哪些成功項目?4. python - scrapy url去重5. 實現(xiàn)bing搜索工具urlAPI提交6. MySQL主鍵沖突時的更新操作和替換操作在功能上有什么差別(如圖)7. mysql在限制條件下篩選某列數(shù)據(jù)相同的值8. 關(guān)于mysql聯(lián)合查詢一對多的顯示結(jié)果問題9. 數(shù)據(jù)庫 - Mysql的存儲過程真的是個坑!求助下面的存儲過程哪里錯啦,實在是找不到哪里的問題了。10. Python從URL中提取域名
