を動作しない私は、1.7から2.0までの速度を更新$のvelocityCountは動作していないとき、およびエラーました:起こる何
[org.apache.velocity.rendering] - Left side ($velocityCount) of comparison operation has null value
を?
私のコードは次の通りである:
"images": [
#foreach($image in $cl.images)
#if($velocityCount <= 3)
#set($img = $cot.encryptUrlForTrans($image.imageUrl))
#set($_img = "http://tf.example.com/tc/img/")
#if($velocityCount != 1),#end
{
"url": "$_img$img?enable=&w=120&h=80&cut=",
"width": 120,
"height": 80
}
#end
#end
]
とNullPointerExceptionが持っている#set($img = $cot.encryptUrlForTrans($image.imageUrl))
ライン?これが実行可能な場合、$ imageはnullでなくてはなりません、どうしたらエラーが発生するのか分かりません。 encryptUrlForTrans(null)メソッドが正しい戻り値を持つためです。
コードの追加方法を教えてください。 – soorapadman