蝶衣 2013-12-23 16:07
浏览 1474

out putStream出错,

<%@ page contentType="text/html" pageEncoding="GBK"%>
<%@ page import="java.io.*"%>




<%
File f=new File("d:"+File.separator+"apache-tomcat-

6.0.37/webapps/ROOT/test.txt");
OutputStream out=null;
out = new FileOutputStream(f) ;

    String str = "Hello World!!!" ;     
    byte b[] = str.getBytes() ;         
    out.write(b) ;                      

    out.close() ;                       
out.close();

%>


错误提示如下

An error occurred at line: 11 in the jsp file: /file.jsp
Duplicate local variable out
8: <%
9:
10: File f=new File("d:"+File.separator+"apache-tomcat-6.0.37/webapps/ROOT/test.txt");
11: OutputStream out=null;
12: out = new FileOutputStream(f) ;

13:

14: String str = "Hello World!!!" ;

An error occurred at line: 20 in the jsp file: /file.jsp
The method write(int) in the type OutputStream is not applicable for the arguments (String)
17:

18: out.close() ;

19: out.close();
20: %>
21:
22:

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题