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
Does title_type contain Chinese?
Refer to [WEB] url path contains Chinese and form get request contains Chinese
Need to transcode Chinese