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")" )