开发者

How to avoid Velocity codes causing whitespaces?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜