javascript - 通过a标签href属性跳转后台乱码问题
问题描述
通过a标签href属性跳转后台乱码问题,试过request.setCharacterEncoding('UTF-8');设置,没有用。
页面代码
<p class='extra'> <a target='_blank' href='https://www.haobala.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. docker - 各位电脑上有多少个容器啊?容器一多,自己都搞混了,咋办呢?2. nignx - docker内nginx 80端口被占用3. docker不显示端口映射呢?4. angular.js使用$resource服务把数据存入mongodb的问题。5. vim - docker中新的ubuntu12.04镜像,运行vi提示,找不到命名.6. docker容器呢SSH为什么连不通呢?7. dockerfile - [docker build image失败- npm install]8. docker start -a dockername 老是卡住,什么情况?9. docker内创建jenkins访问另一个容器下的服务器问题10. android - 优酷的安卓及苹果app还在使用flash技术吗?

网公网安备