views:

18

answers:

1

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?

+2  A: 

What version is your web application? If somehow you are still using JSP 1.2, you have to explicitly set the isELIgnored page directive to false.

erickson
That was it. Thanks.
jts