Velocity 中判空操作

问题:在页面显示时要求若该字段无值则显示无,所以需要对JAVA传值进行判断

解释:该值不为空的时候,为真

方法:
Velocity中判空操作
#if("$!merchant.organizationCertificate" == "")
 	
#else
<img src="$!merchant.organizationCertificate"  width="54" height="54" />
#end




#if(!$!merchant.organizationCertificate)
&nbsp;	
#else
<img src="$!merchant.organizationCertificate"  width="54" height="54" />
#end


参考文献:
http://blog.csdn.net/queenjade/article/details/7641050
http://jiangctry.iteye.com/blog/1485798

猜你喜欢

转载自mingyundezuoan.iteye.com/blog/2209970