首页  >  问答  >  正文

javascript - 通过a标签href属性跳转后台乱码问题

通过a标签href属性跳转后台乱码问题,试过request.setCharacterEncoding("UTF-8");设置,没有用。

页面代码

<p class="extra">
    <a target="_blank" href="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";
    
}

想问问还有没有其他方法实现,解决乱码问题

滿天的星座滿天的星座2686 天前837

全部回复(2)我来回复

  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-06-12 09:21:51

    title_type包含中文吗?
    参考【WEB】url路径包含中文和表单get请求包含中文

    回复
    0
  • 阿神

    阿神2017-06-12 09:21:51

    需要对 中文进行转码

    回复
    0
  • 取消回复