velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eddie" <post2me...@hotmail.com>
Subject Re: Html encoding ?
Date Mon, 19 Mar 2001 16:54:29 GMT

----- Original Message -----
From: Geir Magnusson Jr. <geirm@optonline.net>
To: <velocity-user@jakarta.apache.org>
Sent: Monday, March 19, 2001 1:55 PM
Subject: Re: Html encoding ?


> > Eddie wrote:
> >
> > Hellu,
> >
> > How do you encode special characters like "&" to proper readable html
> > text with velocity ??
> >
> > Does velocity already have a utility for this ? I noticed that
> > velocity doesn't do this automaticaly.
> >
> No, and the reason is that Velocity wasn't specially built for HTML, but
> rather is general in nature (althought great for the web).
>
> > I have a little class, called WebUtil, with a class method (note: not
> > an object method) called htmlEncode. How can I use this in my velocity
> > template ?
>
> When you say 'class not object' do you mean its static?  You still
> should be able to make one of those classes and place it into the
> context, right?

Yep, it's a static class, whereas with ctx.put() I can only push objects, so
how can I use a method of this static class in my template ?

Regards,
Ed Bras

Mime
View raw message