方法一:
String ssdwhbm = new String(getRequest().getParameter("ssdwhbm").getBytes("iso8859-1"),"utf-8");
方法二:
<a href="javaScript:void(0)" onclick="paixu(‘${l.ssdwhbm}‘)" >排序</a>
<script type="text/javascript"> function paixu(ssdwhbm){ var winoption ="dialogHeight:700px;dialogWidth:600px;status:no;scroll:yes;resizable:no;center:yes"; var obj = ‘‘; window.showModalDialog("${ctx}/perInfoCollection_getPerInfoColListPx.do?ssdwhbm="+encodeURI(encodeURI(ssdwhbm))+"&t="+new Date().getTime(),obj,winoption); } </script>
String ssdwhbm = URLDecoder.decode(getRequest().getParameter("ssdwhbm"),"utf-8");
页面l.ssdwhbm是中文参数,winoption是子窗口,encodeURI()转码一次有特殊字符仍然乱码,所以进行二次转码。obj参数new Date()为了去缓存
后台
时间: 2024-10-29 02:09:15