velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Revusky <jrevu...@terra.es>
Subject template encodings
Date Sun, 15 Jul 2001 11:45:41 GMT
I have the Velocity developer guide doc in front of me and I'm looking
at the section entitled "Template Encoding for Internationalization". 

There is a method called mergeTemplate that takes the encoding as an
argument.

My belief is that once you figure out the desired locale, and call
response.setLocale(myLocale) that simply by writing to the Writer object
returned by response.getWriter() that it will (should) be encoded
appropriately.

IOW, this should really be the realm of responsibility of the underlying
servlet engine AFAICS. (Though, that said, I *think* that extra i18n
hook was added as of the 2.2 servlet spec. I explicitly say that Niggle
requires >2.2 servlet engine.)

This is basically the assumption I have gone on in the Niggle framework.
Funny thing, judging from servlet logs, I get a lot of downloads from
Japan and Taiwan. And they keep coming back when I announce a new
version. But I get no feedback from these people as to whether this
actually works! 

In other matters, there is one person who I know to be subscribed to
this list who expressed interest in using Niggle in conjunction with
Velocity. (At the time, only Freemarker and WebMacro were supported.)
There is a preview that allows usage of Velocity as the template engine
available here:

http://revusky.com/dist/niggle1_0_3pre.zip

If you simply read the various references to webmacro and mentally
substitute in velocity, you should be able to get it working with
velocity. There are sample velocity templates for the mini-rolodex
sample app. I will have to patch up the docs before I announce this.
(Probably before mid-week.)

Cheers,

Jonathan Revusky
--
available for Java/Delphi/Internet consulting
If you want to...
- make your .class files double-clickable with SmartJ
- do Delphi/Java mixed programming with easy-to-use JNI wrapper classes
- build robust web applications with the Niggle Application Framework
then...
check out the Revusky Hacks Page: http://www.revusky.com/hacks/

Mime
View raw message