joda:format returns empty string

426 Views Asked by At

I'm using joda:format to format my DataTime object in jspx, but it doesn't look like the tag does anything at all.

At the header of the page, I have this:

<jsp:root xmlns:joda="http://www.joda.org/joda/time/tags">

The field:

<div><joda:format value="${myDateTime}" pattern="MM/dd/yyyy HH:mm:ss" /></div>

The markup after the page finished loading looks like this:

<div>
  <joda:format value="2013-08-31T02:01:57.939-04:00" pattern="MM/dd/yyyy HH:mm:ss">     
  </joda:format>
</div>
1

There are 1 best solutions below

1
On

Add joda-time-jsptags to your classpath.
If you are using maven tool then add this dependency to your web module

<dependency>
    <groupId>joda-time</groupId>
    <artifactId>joda-time-jsptags</artifactId>
    <version>1.1.1</version>
</dependency>  

or download jar from here and add to your project manually