摘要: 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 ... 阅读全文
posted @ 2011-09-28 15:05 shosciation 阅读(270) 评论(0) 推荐(0) 编辑