java下载完之后为啥打不开_请问jsp是什么文件,下载后为什么打不开?

f82ad4c60bce80b27096addb8e145b85.png

2006-09-06

jsp文件怎么打开啊?重装电脑后发现

jsp文件操作之读取篇作者:coolknight出处:yesky责任编辑: [ 2000-11-28 00:00 ]请输入文章摘要关于文件操作讨论的已经很多了,让我们来看看jsp中是如何实现的。   这里用到了两个文件,一个jsp文件一个javabean文件,通过jsp中调用javabean可以轻松读取文本文件,注意请放置一个文本文件afile。txt到web根目录的test目录下,javabean文件编译后将class文件放到对应的class目录下(tomcat环境)。 Read。jsp$#@60;html$#@62;$#@60;head$#@62;$#@60;tit...全部

jsp文件操作之读取篇作者:coolknight出处:yesky责任编辑: [ 2000-11-28 00:00 ]请输入文章摘要关于文件操作讨论的已经很多了,让我们来看看jsp中是如何实现的。

这里用到了两个文件,一个jsp文件一个javabean文件,通过jsp中调用javabean可以轻松读取文本文件,注意请放置一个文本文件afile。txt到web根目录的test目录下,javabean文件编译后将class文件放到对应的class目录下(tomcat环境)。

Read。jsp$#@60;html$#@62;$#@60;head$#@62;$#@60;title$#@62;读取一个文件$#@60;/title$#@62;$#@60;/head$#@62;$#@60;body bgcolor="#000000"$#@62;$#@60;%--调用javabean --%$#@62;$#@60;jsp:useBean id="reader" class="DelimitedDataFile" scope="request"$#@62;$#@60;jsp:setProperty name="reader" property="path" value="/test/afile。

txt" /$#@62;$#@60;/jsp:useBean$#@62;$#@60;h3$#@62;文件内容:$#@60;/h3$#@62;$#@60;p$#@62;$#@60;% int count = 0; %$#@62;$#@60;% while ( xtRecord() != -1) { %$#@62;$#@60;% count++; %$#@62;$#@60;b$#@62;第$#@60;% int(count); %$#@62;行:$#@60;/b$#@62;$#@60;% int( turnRecord()); %$#@62;$#@60;br$#@62;    $#@60;% } %$#@62;$#@60;/p$#@62;$#@60;/body$#@62;$#@60;/html$#@62;//DelimitedDataFile。

java bean文件源代码//导入java包import 。*;import java。util。StringTokenizer;public class DelimitedDataFile{private String currentRecord = null;private BufferedReader file;private String path;private StringTokenizer token;//创建文件对象public DelimitedDataFile(){     file = new BufferedReader(new InputStreamReader( ),1);}public DelimitedDataFile(String filePath) throws FileNotFoundException{         path = filePath;     file = new BufferedReader(new FileReader(path));}     //设置文件路径     public void setPath(String filePath)        {                        ath = filePath;try {file = new BufferedReader(newFileReader(path));} catch (FileNotFoundException e) {             intln("file not found");            }            }//得到文件路径     public String getPath() {        return path;}//关闭文件public void fileClose() throws IOException{         ose();}//读取下一行记录,若没有则返回-1public int nextRecord(){             int returnInt = -1;     try     {     currentRecord = adLine();     }         catch (IOException e)     {     intln("readLine problem, terminating。

");     }         if (currentRecord == null)     returnInt = -1;     else     {     token = new StringTokenizer(currentRecord);     returnInt = untTokens();     }     return returnInt;}    //以字符串的形式返回整个记录public String returnRecord(){return currentRecord;}} 。

收起

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值