logo       

RE: Platform specific line feeds in template files: msg#00142

jakarta.velocity.user

Subject: RE: Platform specific line feeds in template files

Its kinda of out-of-the way, but we have a similar problem with files
being creating in a DOS environment and them moved to a unix server.
Luckly we use ANT to do all the posting to the server from the local
computer, and ANT has a core task for mucking with the CR/LF.
Otherwise, if you are FTP'ing them up (in ASCII mode) the server should
do the conversions automatically for you.

I know this is not was you were asking for, but it is how we solved the
problem.

-----Original Message-----
From: Keith Clarke [mailto:Keith.Clarke@xxxxxxxxxxxxxxxx]
Sent: Monday, May 26, 2003 8:51 AM
To: 'velocity-user@xxxxxxxxxxxxxxxxxx'
Subject: Platform specific line feeds in template files


I have templates created on Windows (i.e. with cr/lf) for some complex
SQL statements. When running the code on Unix, I'd like the output to
have the Unix line separator (lf).

Before I add code to do this myself, is there a way of controlling this
behaviour in Velocity?

The templates are loaded by
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
using a call to Velocity.mergeTemplate with an encoding of ISO-8859-1
with output to a StringWriter.

Thanks,
Keith


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: velocity-user-help@xxxxxxxxxxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise