ajax在tomcat 上正常,部署到weblogic上就出现问题了,提示下载action路径 :
var fileId ;
fileId = 'file';
$.ajaxFileUpload(
{
url:path+'shortMessage/importContactAction.jcms',
type:'POST',
secureuri:false,
fileElementId:fileId,
dataType: 'text',
success: function (data)
{
alert(data)
},
error: function (data)
{
alert("文件读取错误");
}
}
);
问题出在乱码上,修改方法 :
success: function (data)
{
data = decodeURIComponent(decodeURIComponent(escape(data)));
alert(data)
},
java 代码:
PrintWriter out1 = resp.getWriter();
str = java.net.URLEncoder.encode(str.toString(), "utf-8");
out1.print(str);
本文详细探讨了在WebLogic环境中Ajax应用出现的问题,特别是关于下载action路径的变量处理,并提供了针对性的解决方案,同时介绍了如何通过修改乱码处理方法来确保数据正确显示。
1957

被折叠的 条评论
为什么被折叠?



