I'm just starting using Spring and I'm quite new in this terms.
I'm having a problem, I need to convert one String to a Date in jsp, and I had thought to use jstl.
I know that the variable has a String which is: "17/03/2016" (I know It because without a format It displays ok)
I have tried all kind of things to be able of watching this String in format date but I have no idea why It's not working
${object.myattribute} <-- It displays correctly "17/03/2016"
But I need to have It on a date mode. So I decided to try the fmt:formatDate option, but I must be doing something wrong 'cause I can't get the desired result. It even does nothing, and if the value is inside a table, It won't display the table.
I have tried many things but no one gives the correct result:
<fmt:formatDate type="both"
dateStyle="short" timeStyle="short"
value="${object.myattribute}" />
${object.myattribute}
<fmt:parseDate pattern="yyyy-MM-dd" value="${object.myattribute}" var="parsedStatusDate" />
${formattedStatusDate} ${parsedStatusDate}
This shows no result
<fmt:formatDate value='${object.myattribute}' pattern='dd/MM/yyyy' var="objMyAttrib" />
<c:set var="strDate" value="${object.myattribute}"/>
${strDate}
<c:out value="${strDate}"></c:out>
The problem is that no one result can be shown. I suposse that there must be some errors so I can't display this info.
I will continue trying but any idea will be really well received :) I assume that I'm doing something wrong but I can't figure what is what I'm doing wrong or if It can't be done (parse from String to Date in jsp)
Thank you in advance. An example will be also well received.