javascript - 通過a標簽href屬性跳轉后臺亂碼問題
問題描述
通過a標簽href屬性跳轉后臺亂碼問題,試過request.setCharacterEncoding('UTF-8');設置,沒有用。
頁面代碼
<p class='extra'> <a target='_blank' href='http://m.baoyu77737.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');//也實現(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:需要對 中文進行轉碼
相關文章:
1. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問題2. javascript - QWebEngineView 如何爬 angular 的動態(tài)數(shù)據(jù)?3. javascript - 使用angular 的ui-sref 中出現(xiàn)了中文參數(shù),點擊跳轉后瀏覽器的地址欄里出現(xiàn)轉義后的%AE....%a%44. java - ConcurrentHashMap中的get()方法為什么可以不加鎖?5. java - 郵箱如何發(fā)送html內容6. html5 - 這個代碼顯示功能如何實現(xiàn)?7. javascript - 用JS 七牛上傳圖片出現(xiàn)文件已存在的錯誤(file exists)8. 工作近5年,3年Java Web ,近2年前端,未來何去何從?9. css3 - 圖片等比例縮放10. java - 字節(jié)流轉成字符串之后,在通過字符串轉成字節(jié)流后的文件為什么會不一樣?
