STRUTS+AJAX+JSP 请求到后台乱码问题解决方法


在AJAX请求URL之前 把参数进行encodeURI()转码。

如:
复制代码 代码如下:

var fileName=document.getElementById("filePath").value;
if(null!=fileName){
//alert(fileName);
//进行转码 不然后台会乱码
fileName=encodeURI(fileName);

.........AJAX代码

}

« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3