我有一个带有 Calendar (java.util.Calendar) 属性的类,我试图在 JSP 页面中显示时间和日期,但出现此错误:
org.apache.jasper.JasperException:java.lang.IllegalArgumentException:非法模式字符“b”。
JSP:
<c:forEach items="${reports}" var="report" >
<tr>
<td><c:out value="${report.vehicleId}"/></td>
<td><c:out value="${report.vehicleName}"/> </td>
<td><fmt:formatDate value="${report.endTimeAndDate.time} pattern="both" /></td>
<td><c:out value="${report.endTimeAndDate.time}" pattern="both"/> </td>
</tr>
</c:forEach>
Java 控制器类:
@RequestMapping(value="/searchreports")
public ModelAndView SearchReports (...parameters) {
Map<String, Object> map = new HashMap<String, Object>();
List<Report> reports = reportService.SearchReports(vehicleName, start,end);;
map.put("reports", reports);
return new ModelAndView("reportsview", map);
}