![](https://csdnimg.cn/release/download_crawler_static/65227626/bg4.jpg)
实验 3
<%@ page contentType="text/html;charset=GB2312"%>
<HTML>
<BODY BGCOLOR=yellow>
读取名字是的文件:
<jsp:include page="">
<jsp:param name="file" value="D:/Program Files/tomcat/webapps/chapter2 /"/>
</jsp:include>
</BODY>
</HTML>
<%@ page contentType="text/html;charset=GB2312"%>
<%@ page import=".*"%>
<HTML>
<BODY BGCOLOR=cyan>
<P><FONT Size=2 color=bule>
This is .
</FONT>
<FONT Size=4>
<%
String s= ("file");
File f=new File(s);
if())
{
("<BR>文件 "+s+" 的内容: ");
FileReader in=new FileReader(f);
BufferedReader bIn=new BufferedReader(in);
String line=null;
while((line=())!=null)
{
("<BR>"+line);
}
}
else
{
%>
<jsp:forward page="">
<jsp:param name="mess" value="File Not Found"/>
</jsp:forward>
<%
}
%>
评论0
最新资源