velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Reynolds">
Subject RE: Velocity DateTool Coding Examples
Date Thu, 28 Oct 2004 20:11:31 GMT
Hi John,

I was glad to see this recently discussed on the list. I believe i have all
the puzzle pieces but i'm having trouble fitting them together.

Let me simplify my application with an example.

Using struts and JSP, the struts action retrieves a list of Birthday
objects, where is a a simple pojo with just a “birthdate”
variable of type java.util.Date. This java.util.List is saved to a session
attribute, call it “birthdayView”. So in a very simple way, my template
would scroll through the items in the session object like this:

#foreach ($birthday in $birthdayVIew)
             $birthday.birthdate  <br>

the code above just prints the unformatted toString() value of
$birthday.birthdate. Obviously, I want it to be formatted.

What I can’t crack is how to use the Date tool IN THE TEMPLATE to format
the string. Any help is appreciated.

Thanks very much

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message