This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is jsp I/O "File" has been deprecated?  RSS feed

 
eric lee
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
eric lee
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks William, i got it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!