摘要:
Http方式下载,Servlet实现与普通的Servlet处理请求类似,浏览器端输入URL,该URL由tomcat分配给相应的Servlet进行处理,以下为示例代码: 1 public void service(HttpServletRequest req, HttpServletResponse res) { 2 3 File file = new File(fileName); 4 if(file.exists()) { 5 FileInputStream in = new FileInputStream(file); 6 try ... 阅读全文