<%@ tag language="java" pageEncoding="utf-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ 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.trim());
%>
<c:out value="${prettyDate}"/>
I can't figure out if I'm doing something wrong in this tag.
The PrettyTime library is supposed to just print a text version of a data, e.g.:
10 months ago
But I can't tell why this custom tag produces 11 lines of blank text before the "pretty" date in the HTML output?