예외처리 추가

main
이범준 4 weeks ago
parent 5e30594e9f
commit 9e7503848b

@ -96,6 +96,11 @@ public class Rent04Controller extends ApplicationController {
byte[] bytesOfFile = file.getBytes(); byte[] bytesOfFile = file.getBytes();
InputStream in = new ByteArrayInputStream(bytesOfFile); InputStream in = new ByteArrayInputStream(bytesOfFile);
XSSFWorkbook workbook = new XSSFWorkbook(in); XSSFWorkbook workbook = new XSSFWorkbook(in);
try {
in.close(); in.close();
int rowNo = 0; int rowNo = 0;
@ -224,6 +229,9 @@ public class Rent04Controller extends ApplicationController {
mav.addObject("data", result); mav.addObject("data", result);
mav.addObject("saved", true); mav.addObject("saved", true);
} catch(Exception e) {
workbook.close();
}
return mav; return mav;
} }

Loading…
Cancel
Save