I have a program.xml file phycially located in a directory in my web
project class path in WSAD,then in my jsp I am trying to read this file,
I got an error saying the file is not found. Why? When creating File
file = new File("program.xml"); on earth, which directory does JVM tries
to find out the file? Thanks.
P.S. JSP:
<[EMAIL PROTECTED] language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<[EMAIL PROTECTED] import="java.io.File,java.io.FileInputStream"%>
Hello world.<br />
<%
File file = new File("program.xml");
// JVM will fine out the file in the build directory instead of
from the class path
FileInputStream fis=new FileInputStream(file);
byte b[]=new byte[fis.available()];
fis.read(b);
String s = new String(b);
StringBuffer data = new StringBuffer(s);
System.out.println("Data:\n " + data.toString() + "\n");
%>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]