I'm using velocity template in dotCMS template files.
One problem I noticed is that velocity adds whitespaces in html source code.
Let's say I have the following source 开发者_开发知识库code.
#set($test = "aa")
#set($test2 = "aa")
<html>
<head>
...
when I execute the file and view source, I see the following. Basically, The first two lines are blank. How do I avoid it?
---- File Begin ---
<html>
<head>
...
---- File End ----
Velocity has never output whitespace from lines that have only a #set directive on them. Are you sure the blank lines are coming from those #set lines? Other Velocity directives are less consistent about handling whitespace, but #set is pretty clear.
精彩评论