wood burning stoves 2.0*
The moose likes Java in General and the fly likes Velocity new line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Velocity new line" Watch "Velocity new line" New topic
Author

Velocity new line

Konstantin Chikarev
Greenhorn

Joined: Feb 19, 2005
Posts: 26
Hi all! I didn't find how to set new line in velocity variable. Construction like #set ($test = "line1\n line2") doesn't do that.

Thanks


http://antilogics.com/
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
I've done lots with Velocity, but surprisingly never had to do this.

Have you tried doubling the backslash?


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi,

are you possibly using Velocity templates for HTML pages? Then of course a newline in the source code wouldn't be the same as a newline in your HTML page (<br> . That's just a thought because I personally have no experience with Velocity...

Marco
Konstantin Chikarev
Greenhorn

Joined: Feb 19, 2005
Posts: 26
I don't use velocity for HTML.
I've tried It renders as . renders as
I am constructing template from peaces and than giving it to velocity. May be that's the cause.
 
 
subject: Velocity new line
 
Similar Threads
Velocity Template is not encoding charecter,instead throwing an error message.
Gray box where my applet should be
using JLabel to title a JScroller
WA #2 ..... word association
how many objects are created