I haven't been able to figure out how to display a java.time.LocalDate
value in a JSP. In my JSP, I have this:
<fmt:formatDate value="${std.datum}" type="date" pattern="dd.MM.yyyy" var="stdDatum" />
std.datum is of type java.time.LocalDate. When rendering the jsp I get this exception:
javax.el.ELException: Cannot convert 2015-02-14 of type class java.time.LocalDate to class java.util.Date
I'm assuming it's the conversion?
Thanks, john.
This is an old question, but i find it is very best to do a custom tld in this case: without any double conversion to and from String.
Do your own tld file, then override the FormatDate class. Finally, declare your own custom prefix and use custom:formatDate instead of fmt:formatDate.
here is a simplified version
usage in JSP:
WEB-INF/custom.tld file
Then the java class tag file
Yes. You could use fmt:parseDate to do the conversion and then do the formatting. Example below
Good luck.