- 浏览: 296842 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
yahier:
没帮助。。。。。。
利用JS获取经纬度,定位html地图 -
mountainol:
[img][img][img][img][url][flash ...
iPhone面试题解答,真机调试 -
qww_friend:
很不错的一个案例,试了下,没有报错,就是我想要的
Poi读取Excel2007 -
zcw_java:
peng051410 写道啥时候能更新呢?求解! 好久没弄过了 ...
Spring Security-session过期跳出<iframe> -
peng051410:
啥时候能更新呢?求解!
Spring Security-session过期跳出<iframe>
jsp页面
后台接收
调用处理
pom文件
不能下载,改写setting文件,添加maven2资源库
<form class="form_0" id="form1" enctype="multipart/form-data" method="post" action="importToContent.aa"> <input class=" wd_50 btn" type="button" name="back" value="返回" onclick="javascript:window.history.go(-1)" /> <input class=" wd_50 btn" type="button" name="subtn" value="提交" /><label><span class="labelTitle">上传文件地址:</span> <input type="file" name="excelFile" id="Cname" value="" size="45"/> </form>
后台接收
//excel文件批量导入短信 @RequestMapping("/importToContent.aa") public ModelAndView importToContent(HttpServletRequest request,@RequestParam("excelFile") MultipartFile file) throws Exception{ scm.readExcelWriteData(file.getInputStream()); return new ModelAndView("/frames/so_Groupsms_into"); }
调用处理
public int readExcelWriteData(InputStream inp) throws Exception{ Workbook wb = WorkbookFactory.create(inp); int numberRow; //获取第一张表 Sheet st = wb.getSheetAt(0); //获取行数 st.getLastRowNum(); //存储读取的短信 List smsContentList = new ArrayList(); String smsCon = null; //遍历第一张表的所有行 for(int i=0;i<=st.getLastRowNum();i++){ //第一行一般为title不读取 if(i!=0){ Row row = st.getRow(i); //获取第一行数据 //遍历第一行所有的列(单元格) for(int j=0;j<row.getLastCellNum();j++){ Cell cell = row.getCell(j); //获取第一个单元格 //获取单元格类型 switch (cell.getCellType()) { case Cell.CELL_TYPE_STRING: //字符串 System.out.println(cell.getRichStringCellValue().getString()); smsCon = cell.getRichStringCellValue().getString(); break; case Cell.CELL_TYPE_NUMERIC: //数字 if (DateUtil.isCellDateFormatted(cell)) { //判断是否包含日期 System.out.println(cell.getDateCellValue()); } else { System.out.println(cell.getNumericCellValue()); smsCon = String.valueOf(cell.getNumericCellValue()); } break; case Cell.CELL_TYPE_BOOLEAN: //布尔 //System.out.println(cell.getBooleanCellValue()); break; case Cell.CELL_TYPE_FORMULA: //公式 //System.out.println(cell.getCellFormula()); break; default: System.out.println(); } } } if(smsCon!=null&&!smsCon.equals("")){ smsContentList.add(smsCon); } } System.out.println("----------------"+smsContentList.size()+"--------------------"); return 0; }
pom文件
<dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency> <dependency> <groupId>xmlbeans</groupId> <artifactId>xmlbeans</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-stax-api_1.0_spec</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.7</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml-schemas</artifactId> <version>3.7</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.7</version> </dependency>
不能下载,改写setting文件,添加maven2资源库
<mirror> <id>mav.mt</id> <url>http://repo1.maven.org/maven2</url> <mirrorOf>central</mirrorOf> <!-- Spain, Sevilla --> </mirror>
发表评论
-
JavaMail邮件发送以及分线程
2012-10-26 11:18 0@RequestMapping("/reset ... -
小图集成在一张图片上CSS Sprites
2012-08-08 15:09 1139css图片拼合生成器: http://cn.spritegen ... -
Tomcat 6.0的This is very likely to create a memory leak.错误解决
2012-07-13 15:18 7092從Apache Tomcat 5.5升級到6.0,通常不用太大 ... -
Date字段在JSP中显示yyyy-MM-dd
2012-05-23 17:20 3512如果后台提供Bean属性中有一个Date,2012-05-23 ... -
标准标签库JSTL
2012-05-23 17:17 1073<%@ page language="java ... -
HTTPS中Tomct配置
2012-05-22 01:22 1725在命令提示符窗口,进入Tomcat目录,执行以下命令: key ... -
Java对Excel的读写详解(POI)
2012-05-21 11:10 5319<!-- 配置读取excel所需 --> ... -
tomcat5内存管理
2012-04-28 16:53 835bin目录下 setenv.sh文件 JAVA_OPTS=&q ... -
Http协议Post请求模拟
2012-04-23 11:44 952HttpClient client = new Defau ... -
JSP-9大内置对象详解
2012-03-26 23:11 8531.request对象 客户端的请求信息被封装在reques ... -
文件的比特数进度条
2012-02-29 18:12 782数据备份,按文件大小来计算进度条!!demo可供下载 -
JSP中get乱码
2012-02-15 11:52 899消除jsp中get方法传递中文参数的乱码问题 首先, ... -
动态创建样式,导入js
2012-01-05 09:56 1045加载样式 function addCssByLink(ur ... -
http与https
2011-12-29 10:46 985HTTPS(Secure Hypertext Transf ... -
Liunx中tomcat部署工程----无法访问
2011-12-23 17:18 942今天我在myeclipse写了一些测试数据提供给同事用,本地测 ... -
JSP通过Cookie实现自动登录
2011-12-20 10:06 1720一、什么是用户自动登录? 对于我们的网站向已注册用户提 ... -
J2EE过滤器
2011-12-19 14:31 815本文并无高深含量 只为数据备份 谢谢 web.xml &l ... -
小白师傅讲解文件上传
2011-10-31 16:00 950SpringMVC用的不太好,小白师傅是高人!! 先共享代码 ... -
WebXML文件整理
2011-10-19 15:53 948web.xml中有各种各样的标签,了解一下具体标签的具体用途. ... -
测试编码解决方案
2011-09-19 01:04 819要是真的想转换可以都试试:::: out.println( ...
相关推荐
poi读取excel2007和2003兼容工具例子.利用简单工厂方法
解决poi读取excel2007出现内存溢出问题代码参
java poi读取excel 2007 存贮在list中
Java使用apache POI读取xlsx代码以及相关jar包
利用POI读取excel写入到word 利用POI读取excel写入到word 利用POI读取excel写入到word,压缩包里包含了jar包
JAVA IO操作 POI读取excel的内容
NULL 博文链接:https://jumpman.iteye.com/blog/1094537
POI生成Excel POI读取Excel java操作Excel Servlet生成Excel web项目,包含含读取Excel与生成Excel方法
之前用jxl发现不支持excel2007,不得以就去用poi实现excel的读取了!本人亲测的一个实例,支持excel2007!
NULL 博文链接:https://yxhcquedu.iteye.com/blog/828707
POI读取excel的例子
实现了JAVA 窗口,读取EXCEL文件,用poi读取EXCEL内容只是一个小例子
NULL 博文链接:https://tntxia.iteye.com/blog/2017108
apache poi 读取 Excel 的 jar 包 博文链接:https://wxinpeng.iteye.com/blog/231895
使用poi解析excel文件,并将数据写入到数据库 项目说明 这个项目实现的功能是读取excel文件中的数据,解析并写入数据库。 读取的excel文件位于项目目录下的 excel\0805.xlsx 使用IntelliJ IDEA开发此项目 使用MYSQL...
poi读取excel并输出到jsp页面
poi读取excel所需jar包,可用来使用poi读写word excel。
利用poi导出excel2007的时候出现内存溢出,当数据量过大,这种情况就更不容易控制了,这个文档就是解决这类问题,我就是用的这个,数据二十万都没溢出过,希望对大家有帮助。
android5使用poi读取excel,android5使用poi读取excel,android5使用poi读取excel,android5使用poi读取excel