一、实现效果
二、环境
springboot + web依赖
resource文件夹
userInfo.xls 模板excel
三、导入依赖
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-spring-boot-starter</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
为了避免后面,使用jxls导出excel报错:
Your InputStream was neither an OLE2 stream, nor an OOXML stream
pom文件导入
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>