怎么可能啊:method readLine()错误,请大家无必帮我瞧下,谢谢!

bonoji 2004-08-16 05:15:50
我在JSP里操作文件:
FileInputStream input=new FileInputStream(new File(filename));
last=input.readLine();
while(true){
pre=temp;temp=last;
result=search(temp,queryString);
if(result[0]!="")
{ last=input.readLine(); break; }
last=input.readLine();
}
编译错误:
An error occurred at line: 77 in the jsp file: /results.jsp

Generated servlet error:
[javac] Compiling 1 source file

D:\jakarta-tomcat-5.0.19\work\Catalina\localhost\luceneweb\org\apache\jsp\results_jsp.java:231: cannot find symbol
symbol : method readLine()
location: class java.io.FileInputStream
last=input.readLine();
到底怎么回事啊?
...全文
161 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
huihuang79 2004-08-16
  • 打赏
  • 举报
回复
把 FileInputStream input=new FileInputStream(new File(filename));
改为
BufferedReader input = new BufferedReader(
new FileReader(filename));

同时要把 while(true){ 改为 while(last != null){

81,114

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧