引言:太不巧了,刚做完数据的导入工作,又收到一个需求需要做相关的导入导出,正好对于其它的一些工具都有用过,正好拿刚遇见的myExcel练手。
- 开发环境demo是springBoot-web项目.
- 依赖包就省了
- 添加页面html(pom文件需要添加thmef文件依赖)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form enctype="multipart/form-data" method="post" action="/excell/excelImport">
选择Excel表格:<input type="file" name="file"/><br/>
<input type="submit" value="上传"/></form>
</body>
</html>
4,web跳转
5,导入导出controller层
本项目是springCloud项目需要先启动erekaserver服务,再启动feign服务,相关代码再feign里面)
下载demo地址:https://github.com/Zhouzhongshang/springCloudStudy
学习地址:https://github.com/liaochong/myexcel/wiki/Excel%E9%BB%98%E8%AE%A4%E5%AF%BC%E5%87%BA
学习地址:https://jingyan.baidu.com/article/8275fc863e4aef46a03cf620.html