velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Bruhn <domi...@dbruhn.de>
Subject Re: How to use DateTool
Date Tue, 04 Apr 2006 18:51:27 GMT
Hy,
thanks to your response. I added the proposed code to my servlet but nothing 
happens. I use the following code to output the timestamp:
$bu.LastVisited

The function "getLastVisited" of the Class of $bu returns a "Date"-Object. 
This outputs the date in "normal" format, no matter whether DateTool is 
embedded or not. With embedded DateTool I tried the "$bu.LastVisited.long" 
but it simply outputs the string "$bu.LastVisited.long" and not the formated 
date.

So how do I use this tool?

Thanks
TO



Am Dienstag 04 April 2006 19:47 schrieb Nathan Bubna:
> You don't have to use a toolbox to use any of the Generic Tools.  Just
> create an instance and add it to your context before the context is
> merged with the template:
>
> context.put("date", new DateTool());
>
> pretty simple.
>
> On 4/4/06, Dominik Bruhn <dominik@dbruhn.de> wrote:
> > Hy,
> > I want to use the DateTool (
> > http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tool
> >s/generic/DateTool.html ) in my VelocityApplet. I not using Struts. How do
> > I tell Velocity to use this Tool when outputting Dates. Some tell me
> > about a toolbox.xml, but I don't know hwere to place it and with which
> > content. A simple copy of the jar-file to the classpath didn't help.
> >
> > Who can help?
> >
> > Thanks
> > Dominik
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org

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


Mime
View raw message