1、摘要 摘要 近几年,随着因特网技术的迅猛发展,全球信息化的脚步也在不断的加快。 web应用变得越来越普遍的同时也越来越复杂,基于web的动态表格就是一个典型 的实例,不论是企业系统,还是高校教务系统,都有这类功能需求。 本文就是基于上述需求,利用 Apache 公司提出的一个发展比较成熟的 POI 软件包中的 HSSF 接口探索出一条解决 Java 语言操作微软公司 Excel文件的有效 途径。 作者在参阅大量资料的基础上, 首先介绍了本文案例中需要用到的基于 B/S 文件上传与下载的方法,然后提出了操作 Excel文件的几种方法并做了比较,最 后对 Excel文件格式进行了分析并且对 POI
2、 软件包中的 HSSF 接口进行了较深入 的研究。在掌握了相关技术知识的前提下,设计并且完成了基于 B/S 的 Excel数 据输入与输出案例,达到了预期的效果。 关键字:关键字:w webeb 应用应用 POIPOI 软件包软件包 HSSF APIHSSF API ExcelExcel 文件文件 ABSTRACT ABSTRACT In recent years, with the rapid development of Internet technology, global information has also been accelerated pace. Web applicati
3、ons become more popular and more complicated. Web-based dynamic form is a typical example of it. Not only an enterprise system but also a university academic system needs it. This thesis is just to meet that requirement and find a solution to operate Excel document by Java Language with Apache POI H
4、SSF API.After reading a large amount of data,The author first introduced file upload and download methods based on B/S. Then proposed several methods of operating Excel files and compared each method, at last the Excel file format is analyzed and had a depth research on the POI HSSF API.After graspe
5、d the related knowledge,the author designed a case called the data of Excel input and output based on B/S.The result is satisfactory Keywords: web application POI HSSF API Excel file 目录 i 目目 录录 第一章第一章 绪论绪论 .1 1.1 课题的背景及意义 1 1.2 课题来源及主要研究内容 1 1.3 国内外研究发展动态 2 1.4 本文结构安排 3 第二章第二章 基于基于 B/SB/S 实现文件上传与下载实
6、现文件上传与下载.5 2.1 实现文件上传的方法 5 2.1.1 JspSmartUpload 组件实现 5 2.1.2 Common-FileUpload 组件实现 .7 2.1.3 MultipanRequest 组件实现 .8 2.1.4 基于 Java 流的无组件上传 9 2.2 实现文件下载的方法 .10 2.2.1 直接采用超链接方法 10 2.2.2 RequestDispatcher 方式实现下载 10 2.2.3 文件输出流方法实现下载 11 2.3 本章小结 .13 第三章第三章 ExcelExcel 文件的生成与读取文件的生成与读取 15 3.1 操作 Excel 文件的方法 .15 3.2 POI 项目安装 18 3.3 POI HSSF API 介绍 .19 3.3.1 Excel 文件结构简介 19 3.3.2 POI HSSF API 介绍 .20 3.4 本章小结 22 第四章第四章 基于基于 B/SB/S 的的 ExcelExcel 数据输入与输出实现数据输入与输出实现 .23 4.1