Hi, Making URLConnection to a directory under WEB-INF, is the same like writing this url in the explorer. However, You can't go directly to any directory under WEB-INF in that way, which justifies your failure of writing to this directory.
You can write to files in this directory, if you don't use URLConnection. That's what I think Tamir -----Original Message----- From: john-paul delaney [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 22, 2002 10:48 AM To: TC user list Subject: Can servlet write to file in /WEB-INF? I was trying to see if I could write to a file in the /WEB-INF directory but I couldn't get it to work - is there a problem with a servlet writing to this directory or is it just me (again ;( ) ? thanks /j-p. URL url = context.getResource("/contextTest.txt"); URLConnection con = url.openConnection(); con.setDoOutput(true); OutputStream out = con.getOutputStream(); PrintWriter pw = new PrintWriter(new OutputStreamWriter(out)); pw.println("foo"); pw.close(); out.close(); ----------------------- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
