You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Keith Clarke <Ke...@SEPROBILLING.COM> on 2003/05/26 14:51:23 UTC

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@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: Platform specific line feeds in template files

Posted by Bill Chmura <Bi...@Explosivo.com>.
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@SEPROBILLING.COM] 
Sent: Monday, May 26, 2003 8:51 AM
To: 'velocity-user@jakarta.apache.org'
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@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