JSTL fmt formatDate tag is passed as is instead of the desired value

I assign a formatted date to the <form:input> , but instead of the format date, the jstl code is assigned to the text field.

 <form:input path="DOB" value="<fmt:formatDate pattern='dd/MM/yyyy' value='${editableUser.DOB}'/>" /> 
+4
source share
1 answer

Try the following:

 <fmt:formatDate pattern="dd/MM/yyyy" value="${editableUser.DOB}" var="myDateVar"/> <form:input path="DOB" value="${myDateVar}"/> 

Tested and working.

+5
source

All Articles