<%@ taglib uri=“http://java.sun.com/jsp/jstl/core” prefix=“c” %>
@RequestMapping(value="/importPoData", method=RequestMethod.POST)
public String importPurchaseOrder(HttpServletRequest request, @RequestParam MultipartFile myFileName, ModelMap modelMap) throws Exception {
try {
Boolean isExcel2003 = ExcelUtil.isExcel2003(myFileName.getOriginalFilename());
List<ImportLogBase> errorList = orderService.importPoData(myFileName.getInputStream(), isExcel2003);
modelMap.put("errorLogs", errorList);
return "po/poImportLogs";
} catch (IOException e) {
e.printStackTrace();
}
return "importSuccess";
}
<table class="l-table-edit" border='1' id="testTable">
<tr>
<td colspan="4" class=""><font color="red" size="4">失敗原因如下</font></td>
</tr>
<tr>
<td align="center" bgcolor="#E0EFF6"><strong>sheet</strong></td>
<td align="center" bgcolor="#E0EFF6"><strong>行號</strong></td>
<td align="center" bgcolor="#E0EFF6"><strong>提示信息</strong></td>
</tr>
<c:forEach items="${errorLogs}" var="item">
<tr>
<td>${item.sheet}</td>
<td>${item.row}</td>
<td>${item.description}</td>
</tr>
</c:forEach>
</table>