Home  >  Q&A  >  body text

javascript - Jump to background garbled code problem through href attribute of a tag

Jump to the background garbled problem through the a tag href attribute. I tried request.setCharacterEncoding("UTF-8"); setting, but it didn't work.

Page code

<p class="extra">
    <a target="_blank" href="Qtitle/findTypeTitle?title_type=${qtype.title_type}">查看更多>></a>
</p>

Backend code

@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";
    
}

I would like to ask if there are any other ways to implement it and solve the problem of garbled characters

滿天的星座滿天的星座2686 days ago832

reply all(2)I'll reply

  • 女神的闺蜜爱上我

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

    Does title_type contain Chinese?
    Refer to [WEB] url path contains Chinese and form get request contains Chinese

    reply
    0
  • 阿神

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

    Need to transcode Chinese

    reply
    0
  • Cancelreply