struts2 中导入excel
在判断文件类型的时候publicWorkbookcreateWorkBook(InputStreamis)throwsIOException{if(excelFileFi...
在判断文件类型的时候
public Workbook createWorkBook(InputStream is) throws IOException{
if(excelFileFileName.toLowerCase().endsWith("xls")){
returnnew HSSFWorkbook(is);
}
if(excelFileFileName.toLowerCase().endsWith("xlsx")){
returnnew XSSFWorkbook(is);
}
returnnull;
}
报错:cannot convert from HSSFWorkbook to Workbook 展开
public Workbook createWorkBook(InputStream is) throws IOException{
if(excelFileFileName.toLowerCase().endsWith("xls")){
returnnew HSSFWorkbook(is);
}
if(excelFileFileName.toLowerCase().endsWith("xlsx")){
returnnew XSSFWorkbook(is);
}
returnnull;
}
报错:cannot convert from HSSFWorkbook to Workbook 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询