velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Creto <croteauj...@hotmail.com>
Subject Working with POJO with a calendar field
Date Thu, 01 Sep 2011 03:30:59 GMT

Hi,
  I would like to get some hints, about working with java.util.Calendar.

Let’s say I have an object like this:

Public class Subscriber {
   Private String name;
   Private Calendar birthday;
}

I would like to use this field in a template, without having to go through a
DateTool kinda thing. By that I mean, instead of having to pass a DateTool
in my context, then in my template use it with something like
$myDateTool.format(‘yyyy-MM-dd’, $subscriber.birthday), I would like to use
something shorter, like $subscriber.birthday, and get it formatted
automatically to something humanly readable. Is this possible? Can I
register a class somewhere telling Velocity that if he needs to handle a
java.util.Calendar, format it a certain way?

Thank you in advance

Jean-Francois Croteau

-- 
View this message in context: http://old.nabble.com/Working-with-POJO-with-a-calendar-field-tp32377112p32377112.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message