在eclipse使用commons.uploadfile时提示"The type DiskFileUpload is deprecated",请问这是为什么

rynewood 2006-09-01 11:52:20
在eclipse使用commons.uploadfile时,语句"DiskFileUpload fu = new DiskFileUpload ();"
上被画了横线,并提示“The type DiskFileUpload is deprecated”,请问这是为什么?
package com.upload;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.*;
import javax.servlet.http.*;

import org.apache.commons.fileupload.*;
import org.apache.commons.io.*;



public class Upload extends HttpServlet {

/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

try{

DiskFileUpload fu = new DiskFileUpload ();

}
catch(Exception e){

}
}

/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occure
*/
public void init() throws ServletException {
// Put your code here
}

}
...全文
1082 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
LoddChen 2006-10-18
  • 打赏
  • 举报
回复
DiskFileItemFactory和ServletFileUpload两个类一起替代过时的DiskFileUpload类.
javadoc里有提到这一点
Cuealive 2006-09-13
  • 打赏
  • 举报
回复
DiskFileItemFactory
Camelh 2006-09-01
  • 打赏
  • 举报
回复
DiskFileUpload 说明这个类过时了,在以后的新版本中可能被取消掉,最好不要用过时的类或者方法;查一查文档看用什么新类替代了,直接使用那个替代类

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧