Re: Need help displaying Korean characters in velocity template

2006-08-17 Thread mailmur
UnicodeFileResourceLoader: http://koti.mbnet.fi/akini/java/unicodereader/ You could try using UnicodeFileResourceLoader and always save your .vm templates as UTF-8 files. Actually you should use UTF-8 with bom marker format. It is what windows Notepad does when saving utf8 files. Or you may use

Re: [HELP] How can I set pageEncoding in Velocity (.vm page)

2006-06-22 Thread mailmur
I have own servlet where I handle requests. I try to create all webapps as UTF-8 enabled, no options allowed. Even all config files are stored as utf-8_with_bom files :-) I use my UnicodeReader to read all .properties files and .vm files. I save files as UTF-8_withBOM text files, Windows Notepad

RE: CustomResourceLoader Not Found in Tomcat 4.x

2006-06-03 Thread mailmur
About copying velocity.jar to tomcat/common/lib folder. Did you put StringResourceLoader.class to webapps/mywebapp/WEB-INF/lib/xxx.jar package (or WEB-INF/classes folder)? If yes then maybe it was about the ClassLoader instance that was giving your problems. common/lib classes are loaded by a

Re: Rationale for Velocity?

2006-01-12 Thread mailmur
Where I use Velocity tools is not rendering html pages. I solely use it as sql rendering utility. I have template files where I have sql queries. I use velocity to create the final sql formula string and run it against the database. And applications are nothing to do with Tomcat, JSP, servlet

Re: file.resource.loader

2006-01-10 Thread mailmur
As always in _Java_, use / path separator even in Windows. This way its portable across *Nix and Win platforms. And secondly, you dont have to escape path separator. \t might map to TAB character. file.resource.loader.path = c:/templates --- M. Hossein Amerkashi [EMAIL PROTECTED] wrote: Hi,

Re: Write a custom resourceloader

2005-11-24 Thread mailmur
See this JIRA document. I will reevaluate my contribution (still havent dont it) and submit it to Velocity1.5 codebase. But you should fine UnicodeResourceLoader custom class and example application. Maybe it helps you resolve the why velocity.properties did not work for you.

Re: [HELP] browser counldn't recognize charset=UTF-8 in meta tag :(

2005-11-10 Thread mailmur
://koti.mbnet.fi/akini/java/unicodereader/ --- Pham Anh Tuan [EMAIL PROTECTED] wrote: Thank you Nathan and mailmur, my problem is solved, it's just because I only saved properties file under UTF-8 with content like: tôi yêu Việt Nam, so it's not showed correctly. So, to let everything

Re: [HELP] browser counldn't recognize charset=UTF-8 in meta tag :(

2005-11-09 Thread mailmur
Is your properties file read as UTF-8 encoded text file? You could test this like the following: Properties p = read your propfile as you do now if (p.getProperty(hello).equalsIgnoreCase(\u_ encoded_value)) { System.out.println(match ok); } This makes sure you have got the value correctly,

UnicodeFileResourceLoader contributed

2005-09-19 Thread mailmur
. UnicodeFileResourceLoader uses a customized InputStream implementation to skip utf8 bom marker bytes. t. Mailmur From JIRA page: Hi Mailmur. I'm going through some old issues. Thanks for contributing this. Sorry it's been such a long time. Would you be willing to place this code (or a link to your web page

Re: RoadMap

2005-08-06 Thread mailmur
In the meantime you can download the nightly snapshot of the source code here: http://cvs.apache.org/snapshots/velocity/ Check out the changelog for the latest list of items added. I've always wanted to see whats been changed prior to my local subversion and server versions. Is there

Re: Loaders and Hashtable+Vector legacy use?

2005-07-05 Thread mailmur
I probably get changes later in a update command. --- Will Glass-Husain [EMAIL PROTECTED] wrote: Hi Mailmur, Thanks again for doing this. Do you have the command line svn client installed? You should be able to cd to the root Velocity directory, then type at the command line svn

Re: Loaders and Hashtable+Vector legacy use?

2005-07-05 Thread mailmur
build.xml changes: manifest.mf file: It is like windows secondaryClick/Version tabsheet information where we can see version info etc. See my webpage zipfile, where you should find src/META-INF/MANIFEST.MF file. I believe diff did not include it (just realized). So to summarize: * meaninfull

Re: Loaders and Hashtable+Vector legacy use?

2005-07-04 Thread mailmur
The following changes where made * added src/java/META-INF/MANIFEST.MF file _all_ java packages should have a _meaninfull_ manifest file. This is a sort of win exefile's VersionInfo tabsheet and is really a good quality of service. * modified build/build.xml file

Re: Loaders and Hashtable+Vector legacy use?

2005-06-30 Thread mailmur
and create a patch. If ant test passes I'll commit it straight away. - Original Message - From: mailmur [EMAIL PROTECTED] org\apache\velocity\runtime\resource\loader\FileResourceLoader.java This class uses Vector and Hashtable instances to store cached paths values. Should

Re: Initializing Velocity ouside of a servlet

2005-06-30 Thread mailmur
Here is a small standalone test program, It uses my customized UnicodeFileResourceLoader. But it should give you a good example how to use it outside of any app server. http://koti.mbnet.fi/akini/java/unicodereader/ I have actually used Velocity as a sql query generator. I have sql template files

Loaders and Hashtable+Vector legacy use?

2005-06-27 Thread mailmur
File: org\apache\velocity\runtime\resource\loader\FileResourceLoader.java This class uses Vector and Hashtable instances to store cached paths values. Should this and other classes be converted to use ArrayList and HashMap instances? I think ArrayList+Hashmap give better runtime performance.

Re: Charset (Struts and Velocity)

2005-02-11 Thread mailmur
On Friday 11 February 2005 17:45, Shinobu Kawai wrote: It's all Java stuff. Java stores data in memory as Unicode, so everything going into Java must be converted into Unicode. Currently, there is no way Java can tell whether a file is ascii or Greek or Japanese or whatever. So,

Re: Velocity Unicode Characters

2005-02-01 Thread mailmur
Velocity supports unicode fine without my resource reader. Due to a java bug cannot handle UTF-8 bommarker properly. So, I've created a UnicodeFileResourceLoader to support UTF-8 bommarker. See my webpage for a small test program. http://koti.mbnet.fi/akini/java/unicodereader/ If you use Windows