| Author |
Is jsp I/O "File" has been deprecated?
|
eric lee
Ranch Hand
Joined: Nov 04, 2002
Posts: 86
|
|
I use TomCat 4.0,Win2000 ,got error " deprecated " ------------------------------------------------- <%@ page contentType="text/html; charset=Big5"%> <HTML> <HEAD> <% String path = request.getRealPath("."); File f = new File(path, "File.txt"); if(f.exists()) { f.delete(); out.println(path + "\\File.txt"); %> <FONT SIZE = 4 COLOR = red>exist</FONT>, <FONT SIZE = 4 COLOR = red>del</FONT> <% } else { f.createNewFile(); out.println(path + "\\File.txt"); %> <FONT SIZE = 4 COLOR = red>not exist</FONT <FONT SIZE = 4 COLOR = red>create</FONT> <% } %> </BODY> </HTML>
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12265
|
|
No, java.io.File has not bee deprecated and all the methods in your code are still there. Usually a deprecated message is a bit more detailed. I don't see where you are importing java.io.File - could that be the problem? Bill [ February 24, 2003: Message edited by: William Brogden ]
|
Java Resources at www.wbrogden.com
|
 |
eric lee
Ranch Hand
Joined: Nov 04, 2002
Posts: 86
|
|
|
Thanks William, i got it
|
 |
 |
|
|
subject: Is jsp I/O "File" has been deprecated?
|
|
|