Is it possible to create a date value in JSTL Expression Language (EL) without using scriptlets? Here is a snippet of some of the legacy code I'm trying to refactor to only use EL.
<td><%=new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm z").format(new java.util.Date())%></td>
Apparently it prints out the current date and time. I know I can format a date using EL, but can I get a date using EL?
I don't think you can do this in EL. But how about this, no scriptlets here
<jsp:useBean id="today" class="java.util.Date" scope="page" />
<fmt:formatDate value="${today}" pattern="MM.dd.yyyy" />
Thid would be helpfull if you use spring webflow framework
if you define this on the flow.xml
<on-start>
<set name="flowScope.now" value="new java.util.Date()" />
</on-start>
You can get the value like this
<fmt:formatDate value="#{now}" pattern="MM.dd.yyyy" />