I'm trying to convert some timestamp values from a collection to a human readable date format. Within a jsp, I've coded this loop:
<c:forEach items="${tokenCollection}" var="tokenCollection" varStatus="status">
<jsp:setProperty name="dateValue" property="time" value="${tokenCollection.value.timestamp}" />
<fmt:formatDate value="${dateValue}" pattern="MM/dd/yyyy HH:mm" />
<!-- Correctly prints values as "40aa4ab4-f6c1-458a-9v3d-5d13b872d9c2" -->
<c:out value="${tokenCollection.value.value}"/>
<!-- Correctly prints values as "1378722681816" -->
<c:out value="${tokenCollection.value.timestamp}"/>
</c:forEach>
Unfortunately, all I get by running it is:
org.apache.jasper.JasperException: An exception occurred processing JSP page /session_management.jsp at line 36
33: <p>Dati di sessione - utente "<c:out value="${username}" />"</p>
34:
35: <c:forEach items="${tokenCollection}" var="tokenCollection" varStatus="status">
36: <jsp:setProperty name="dateValue" property="time" value="${tokenCollection.value.timestamp}" />
37: <fmt:formatDate value="${dateValue}" pattern="MM/dd/yyyy HH:mm" />
38: <c:out value="${tokenCollection.value.value}"/>
39: <c:out value="${tokenCollection.value.timestamp}"/>
org.apache.jasper.JasperException: org.apache.jasper.JasperException: java.lang.NumberFormatException: For input string: "${tokenCollection.value.timestamp}"
As stated in the comments, values are retreived correctly, so ${tokenCollection.value.timestamp} is by all means a timestamp (like 1378722681816). Still, I can't figure out how to fix this issue, or what exactly I'm being wront at. Any hints?