一个JAVABEAN的例子程序出问题。(在线)

xddy xddy 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
counter.java
----------------

import java.io.*;
public class counter extends Object {
private String currentRecord =null;
private String path =null;
private BufferedReader file;


public String ReadFile(String filePath) throws FileNotFoundException
{
path = filePath;
file = new BufferedReader(new FileReader(path)) ;
String returnStr=null;
try
{
currentRecord = file.readLine();

}
catch(IOException e)
{
System.out.println(e+"读取数据错误");

}
if (currentRecord==null)
currentRecord="没有记录";
else
{
returnStr=currentRecord;
}
return returnStr;

}

public void WriteFile(String filePath,String counter) throws FileNotFoundException
{
path = filePath;
int Writerstr =Integer.parseInt(counter)+1;

try
{
//?????
//PrintWriter pw = new PrintWriter(new FileOutputStream(filePath));
PrintWriter pw = new PrintWriter(new FileOutputStream(path));
pw.println(Writerstr);
pw.close();
}
catch(IOException e)
{
System.out.println(e+"写入文件错误");
}

}


}

在DOS下可以编译通过。但执行时JSP页面是出现问题。
我就哪到JBUILDER 6中却连编译也通不过
...全文

相关推荐

评论 10
收藏 已收藏
分享
返回顶部
xddy
Web 开发 81,108 成员 341,721 内容