解析速度中的整数时出现NumberFormatException

时间:2012-04-06 10:42:34

标签: parsing velocity

//$colspan是字符串中的数字(例如$colspan="5")。在解析时,有时它会提供 NumberFormatException 。任何帮助将不胜感激。

#set($Integer=0)       
#if($Integer.parseInt($colspan)>1)
 //some code here.....
#end

1 个答案:

答案 0 :(得分:2)

为什么不使用VelocityTools项目中的MathTool或NumberTool。