Dialog中url传参中文乱码问题

xiaoxiao2021-02-28  145

js传参

<script type="text/javascript"> function openDialog(url,title,width,height){ var uncodeUrl = encodeURI(encodeURI(url)); $.dialog({ title:title, width: width, height:height, max:false, min:false, content: 'url:'+uncodeUrl }); } }

jsp页面(${data.infoStr}z中含有中文)

<a href="#" onclick="openDialogView('${context_path}/dcim/view/${data.infoStr}','查看信息',700,400)">查看</a>

后台接参

@RequestMapping(value="/view/{infoStr}",method = RequestMethod.GET) public ModelAndView view(@PathVariable("infoStr")String infoStr,Model model) throws UnsupportedEncodingException{ String info = java.net.URLDecoder.decode(infoStr, "utf-8"); }
转载请注明原文地址: https://www.6miu.com/read-36748.html

最新回复(0)