您的位置:首頁技術文章
文章詳情頁

javascript - 通過a標簽href屬性跳轉后臺亂碼問題

瀏覽:83日期:2023-11-12 11:00:05

問題描述

通過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:

需要對 中文進行轉碼

標簽: JavaScript
相關文章:
国产综合久久一区二区三区