javascript - 通過a標簽href屬性跳轉后臺亂碼問題
問題描述
通過a標簽href屬性跳轉后臺亂碼問題,試過request.setCharacterEncoding('UTF-8');設置,沒有用。
頁面代碼
<p class='extra'> <a target='_blank' href='http://www.wxshucaidpc.com/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. python判斷字符串相等?2. MySQL 截短某一列的字符串3. java - new + 類名,一定需要申明一個對象嗎?4. python - lxml.etree為什么會自動加上加上</i>?5. HTML表單操作標簽調用父相對URL6. android - 京東app下面的table背景怎么實現的?7. css3 - 如圖的flex骰子布局是怎么實現的?8. 彈出式菜單 - android京東優惠券中心彈出菜單的實現?9. java - mac下配置ndk環境變量10. css - BEM 中塊(Block)有木有什么標準 何時決定一個部分提取為塊而不是其父級的元素呢(Element)?~
