jsp中路径带中文转码传给后台
1.jsp上方需要导入包
<%@ page import="java.net.*" %>
2.js中代码,其实就是encodeURI(encodeURI(prodName))这段转码,写成encodeURI(prodName)不成功
//设置按钮 function setHotPrivateProduct(prodCode,prodName){ openDialog('设置热销产品', '${ctx}/hotproduct/getHotPrivateProduct?prodCode='+prodCode+'&prodName='+encodeURI(encodeURI(prodName)),'800px', '500px'); }
3.后台接收,转码
String prodName= java.net.URLDecoder.decode(prodName,"UTF-8");