<%@ 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: