xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 13KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-08
  • 語言: Java
  • 標簽: Javabean??JSP??

資源簡介

利用Javabean+JSP 實現文件的上傳、顯示、下載 實現文件上傳功能和下載功能,顯示文件列表和讀取文件內容功能。

資源截圖

代碼片段和文件信息

package?com.file;

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

import?javax.servlet.ServletException;
import?javax.servlet.http.HttpServlet;
import?javax.servlet.http.HttpServletRequest;
import?javax.servlet.http.HttpServletResponse;

import?com.jspsmart.upload.SmartUpload;
import?com.jspsmart.upload.SmartUploadException;

/**?
?*?@author?yilong?
?*?創建時間:2017-5-23?上午10:09:10?
?*?
?*/
public?class?downfile_handle?extends?HttpServlet?{

/**
?*?The?doPost?method?of?the?servlet.?

?*
?*?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?{
//獲取下載文件名
String?fileName?=?request.getParameter(“filename“);
//新建一個smartUpload對象
SmartUpload?smartUpload?=?new?SmartUpload();
//初始化
smartUpload.initialize(this.getServletConfig()?request?response);
//設定contentDisposition為null以禁止瀏覽器自動打開文件
//保證單擊鏈接后是下載文件。
smartUpload.setContentDisposition(null);
//下載文件
try?{
smartUpload
.downloadFile(“/“
+?fileName);
}?catch?(SmartUploadException?e)?{
e.printStackTrace();
}
}

}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-05-22?19:37??exp6\
?????文件?????????603??2017-05-22?20:14??exp6\.classpath
?????目錄???????????0??2017-05-22?19:37??exp6\.myeclipse\
?????文件?????????285??2017-05-22?19:37??exp6\.mymetadata
?????文件????????1747??2017-05-22?20:13??exp6\.project
?????目錄???????????0??2017-05-22?22:50??exp6\.settings\
?????文件?????????500??2017-05-22?19:37??exp6\.settings\.jsdtscope
?????文件?????????364??2017-05-22?19:37??exp6\.settings\org.eclipse.jdt.core.prefs
?????文件?????????450??2017-05-22?19:37??exp6\.settings\org.eclipse.wst.common.component
?????文件?????????252??2017-05-22?19:37??exp6\.settings\org.eclipse.wst.common.project.facet.core.xml
?????文件??????????49??2017-05-22?19:37??exp6\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2017-05-22?19:37??exp6\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2017-05-23?10:09??exp6\src\
?????目錄???????????0??2017-05-23?10:09??exp6\src\com\
?????目錄???????????0??2017-05-23?10:09??exp6\src\com\file\
?????文件????????1507??2017-05-23?10:10??exp6\src\com\file\downfile_handle.java
?????目錄???????????0??2017-05-23?11:33??exp6\WebRoot\
?????文件????????1103??2017-05-23?10:17??exp6\WebRoot\downfile.jsp
?????文件????????1033??2017-05-23?09:14??exp6\WebRoot\downfile_handle.jsp
?????文件?????????829??2017-05-22?19:37??exp6\WebRoot\index.jsp
?????文件????????2938??2017-05-23?11:39??exp6\WebRoot\listdir.jsp
?????目錄???????????0??2017-05-22?19:37??exp6\WebRoot\meta-INF\
?????文件??????????36??2017-05-22?19:37??exp6\WebRoot\meta-INF\MANIFEST.MF
?????文件?????????923??2017-05-22?22:54??exp6\WebRoot\upfile.jsp
?????文件????????1265??2017-05-23?08:49??exp6\WebRoot\upfile_handle.jsp
?????目錄???????????0??2017-05-22?19:37??exp6\WebRoot\WEB-INF\
?????目錄???????????0??2017-05-23?10:12??exp6\WebRoot\WEB-INF\classes\
?????目錄???????????0??2017-05-23?10:12??exp6\WebRoot\WEB-INF\classes\com\
?????目錄???????????0??2017-05-23?10:12??exp6\WebRoot\WEB-INF\classes\com\file\
?????文件????????1619??2017-05-23?10:12??exp6\WebRoot\WEB-INF\classes\com\file\downfile_handle.class
?????目錄???????????0??2017-05-22?19:37??exp6\WebRoot\WEB-INF\lib\
............此處省略1個文件信息

評論

共有 條評論