The string:
${prettyDate}
is output to the page by this custom tag instead of the prettified Date string:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ tag import="com.ocpsoft.pretty.time.PrettyTime, java.util.Date"%>
<%@ attribute name="dateParam" required="true" type="java.util.Date" %>
<%
PrettyTime p = new PrettyTime();
String prettyDate = p.format(dateParam);
jspContext.setAttribute("prettyDate", prettyDate);
%>
<c:out value="${prettyDate}"/>
Why am I doing that prevents the scriptlet attribute (prettyDate
) from being transferred to the JSTL in this JSP custom tag?