Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am assigning the formatted date to an <form:input> tag but instead of the formatted date, the jstl code is allocated to the textfield.

<form:input path="DOB" value="<fmt:formatDate pattern='dd/MM/yyyy' value='${editableUser.DOB}'/>" />
like image 796
h-rai Avatar asked Apr 29 '13 00:04

h-rai


1 Answers

Try this:

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

Tested and Working.

like image 175
venki Avatar answered Oct 06 '22 06:10

venki