@RequiresPermissions("addresslist:addressList:import")
@RequestMapping(value = "import", method=RequestMethod.POST)
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
try {
int successNum = 0;
int failureNum = 0;
StringBuilder failureMsg = new StringBuilder();
ImportExcel ei = new ImportExcel(file, 1, 0);
HSSFWorkbook wx = new HSSFWorkbook(file.getInputStream());
XSSFWorkbook wb = new XSSFWorkbook(file.getInputStream());
XSSFSheet sheet=wb.getSheetAt(0);jsp页面 <table:importExcel url="${ctx}/addresslist/import"></table:importExcel><!-- 导入按钮 -->
@RequestMapping(value = "import", method=RequestMethod.POST)
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
try {
int successNum = 0;
int failureNum = 0;
StringBuilder failureMsg = new StringBuilder();
ImportExcel ei = new ImportExcel(file, 1, 0);
HSSFWorkbook wx = new HSSFWorkbook(file.getInputStream());
XSSFWorkbook wb = new XSSFWorkbook(file.getInputStream());
XSSFSheet sheet=wb.getSheetAt(0);jsp页面 <table:importExcel url="${ctx}/addresslist/import"></table:importExcel><!-- 导入按钮 -->
解决方案 »
- 关于Map取值对应到的键问题
- 要选择技术架构,请教用socket和用webservice有什么区别各自的优缺点,请牛人给予指点
- 急求MyEclipse_6_0_1GA_E3_3_1_Installer.bin 文件
- MySql中插入中文报错:incorrect string value
- 我们一般是在action中写hql语句然后传到dao中呢,还是直接在dao中写hql语句
- java怎么处理韩文乱码问题
- Axis2 无返回值的异步调用
- 求以下SQL的写法!
- 初练JSP,刚装了TOMCAT,就遇到一个小问题.为什么TOMCAT的管理页面进不了?
- hibernate delete-orphan的问题
- checkbox怎么控制单选?sturts2怎么表单批量提交
- hibernate org.hibernate.HibernateException: HHH000142:
给你一个链接,你参考下,完整的实例
http://blog.csdn.net/layman1024/article/details/72627037