当前位置: 代码迷 >> Java Web开发 >> 路径在js里取出来的是E:Tomcat6.0webappssilu$4.xls ,放到request的路径是E:\Tomcat6.0\webapps\silu\444.xls,该怎么解决
  详细解决方案

路径在js里取出来的是E:Tomcat6.0webappssilu$4.xls ,放到request的路径是E:\Tomcat6.0\webapps\silu\444.xls,该怎么解决

热度:629   发布时间:2016-04-17 12:24:17.0
路径在js里取出来的是E:Tomcat6.0webappssilu$4.xls ,放到request的路径是E:\Tomcat6.0\webapps\silu\444.xls
代码:
action中:
String filePath = request.getRealPath("/") + upfileForm.getFiledata().getFileName();
request.setAttribute("filePath", filePath); 这里路径是:E:\Tomcat6.0\webapps\silu\444.xls

.........
js:
<%
  String filePath = request.getAttribute("filePath")+"";
  System.out.println("filePath:" + filePath);E:\Tomcat6.0\webapps\silu\444.xls
%>
......

<script language="JavaScript" type="text/JavaScript">
  <logic:notEmpty name="echo">
  alert("<%=basePath%>/upload/upload.do?method=override&filePath=<%=filePath%>");E:Tomcat6.0webappssilu$4.xls
  if(confirm('${echo}')){
window.location="<%=basePath%>/upload/upload.do?method=override&filePath=<%=filePath%>";
}
</logic:notEmpty>
</script>

路径在js里显示不正确

------解决方案--------------------
重大消息: 法国政府准备拿出二千万美金 家乐福自己再拿出五百万美金 用于五一降价促消 听说家乐福高层很狂妄 让中国人在五一降价中挤破家乐福 最好踩死几个人.法国电视台也在积极做准备 拍摄中国人到家乐福疯狂购物的镜像.让中国人自打自的嘴. 
如果是爱国的中国人 把此信息传给你的亲戚朋友
------解决方案--------------------
\这个没有了?
------解决方案--------------------
"/"号要转义才行的。
  相关解决方案