File f = new File("文件路径");//特定文件路径如:c:\aaa(文件夹)\aaa.gif(特定文件名)
if(f.exists()){
out.print("<script language=javascript>window.open().....(js打开窗口 具体自己写吧);</script>");
}
if(f.exists()){
out.print("<script language=javascript>window.open().....(js打开窗口 具体自己写吧);</script>");
}
解决方案 »
- struts.xml配置 Json返回值勤 <param name="root">XX</param>不理解是什么意思
- 求一个fckeditor jsp 文本编辑器
- 明日将被通报,今天注定是个难忘的日子
- 根据用户登陆动态生成在线用户下来列表
- struts 1.x文件上传
- 遇到org.apache.jasper.JasperException: Module 'null' not found问题,请教什么原因导致的?
- 【AXIS2】关于在报文中添加请求头的问题,求高手帮忙
- 100分相送!请问各位高手,通常将J2EE基本学明白要用多长的时间?
- 用Java编的上位机,串口通信问题!!!求解!
- 正则表达式限制输入
- 在spring下用quartz的问题
- 谁给我讲下XML里的attribute和feature到底有什么区别!!!谢谢!!!
btw:我就是要写在<%%>的代码啊
<%@ page import="java.io.*"%>
<html>
<head>
<title>读文件</title>
</head>
<body>
<script language=javascript>
File f = new File("popInfo.htm");
if(f.exists()){
window.open("popInfo","",strStation);
}
</script>
</body>
</html>
<%
File f = new File("文件路径");//特定文件路径如:c:\aaa(文件夹)\aaa.gif(特定文件名)
if(f.exists()){
out.print("<script language=javascript>window.open().....(js打开窗口 具体自己写吧);</script>");
}
%>
File f = new File("文件路径");//这里的文件路径要写成c:\aaa(文件夹)\aaa.gif(特定文件名),好像必须带盘符,真的是这样吗?
String sWjlj = "文件相对路径";
String sFileName = "文件名";//主文件名+扩展名
File f = new File(sPath+sWjlj+sFileName);其中sPath+sWjlj+sFileName 可根据实际情况需要拼加“\\”,保证路径的完整
结贴!