javascript - 通過a標(biāo)簽href屬性跳轉(zhuǎn)后臺(tái)亂碼問題
問題描述
通過a標(biāo)簽href屬性跳轉(zhuǎn)后臺(tái)亂碼問題,試過request.setCharacterEncoding('UTF-8');設(shè)置,沒有用。
頁(yè)面代碼
<p class='extra'> <a target='_blank' href='http://m.lshqa.cn/wenda/Qtitle/findTypeTitle?title_type=${qtype.title_type}'>查看更多>></a></p>
后臺(tái)代碼
@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請(qǐng)求包含中文
回答2:需要對(duì) 中文進(jìn)行轉(zhuǎn)碼
相關(guān)文章:
1. Python從URL中提取域名2. php傳對(duì)應(yīng)的id值為什么傳不了啊有木有大神會(huì)的看我下方截圖3. python - scrapy url去重4. python - Flask寫的注冊(cè)頁(yè)面,當(dāng)注冊(cè)時(shí),如果填寫數(shù)據(jù)庫(kù)里有的相同數(shù)據(jù),就報(bào)錯(cuò)5. 關(guān)于mysql聯(lián)合查詢一對(duì)多的顯示結(jié)果問題6. 實(shí)現(xiàn)bing搜索工具urlAPI提交7. 數(shù)據(jù)庫(kù) - Mysql的存儲(chǔ)過程真的是個(gè)坑!求助下面的存儲(chǔ)過程哪里錯(cuò)啦,實(shí)在是找不到哪里的問題了。8. python - oslo_config9. MySQL主鍵沖突時(shí)的更新操作和替換操作在功能上有什么差別(如圖)10. 小白學(xué)python的問題 關(guān)于%d和%s的區(qū)別
