`
xulongfa
  • 浏览: 70088 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

velocity中的null与“”

阅读更多

问题:vecolity中 #set($test=$map.getAtttibute("key"))
         如果map.getAtttibute("key")为null,那么$test是null还是""  ?

结论:velocity引擎会报错:RHS of #set statement is null. Context will not be modified .

 

所以说最好是加上引号 ("")|感叹号 (!),  即#set($test=" $! map.getAtttibute("key")" )

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics