页面死在那里,进度条走了一半不动了
挨踢啊挨踢 2004-09-07 03:50:44 我刚接触jsp,在按部就班的照着书测试代码呢,其他代码都可以运行,可就是有的页面死在那里,进度条走了一半不动了。有可能是什么原因呢,谢谢。
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.io.*" %>
<html><body>
<% File dir=new File("C:/Tomcat5.0","tdh");
dir.mkdir();
File f=new File(dir,"tdh.txt");
try
{
FileOutputStream outfile=new FileOutputStream(f);
BufferedOutputStream bufferout=new BufferedOutputStream(outfile);
byte b[]="hello,i am glad to see you!<br> nice to meet you".getBytes();
bufferout.write(b);
bufferout.flush();
bufferout.close();
outfile.close();
FileInputStream in=new FileInputStream(f);
BufferedOutputStream bufferin=new BufferedOutputStream(in);
byte c[]=new byte[90];
int n=0;
while((n=bufferin.read(c))!=-1)
{
String temp=new String(c,0,n);
out.print(temp);
}
bufferin.close();
in.close();
}
catch(IOException e)
{}
%>
</body></html>