現場のプロジェクトでView層にVelocityを使っているので、今更ながら記述ルールを整理。 ルール 記述例 オブジェクトを表示するときは必ずサイレント記法を使う $!hogeNullObj オブジェクトのnull判断はオブジェクトをそのまま指定する #if($hogeNullObj)hoge#end 条件の反転はJavaと同様に!を付与する #if(!$hogeObj)hoge#end オブジェクトの値の比較は必ずnullチェックしてから行う #if($hogeNullObj && $hogeNullObj == 1)hoge#end foreach文ではオブジェクトがnullの場合もnullチェックは必要ない #foreach($hogeObj in $hogeNullObj)$hogeObj#end マクロを使うときはマクロ側にサイレント記法を指定する $!esc.html($ho