Parsing 解析velocity中的整数时出现NumberFormatException

Parsing 解析velocity中的整数时出现NumberFormatException,parsing,velocity,Parsing,Velocity,/$colspan是字符串中的数字(例如$colspan=“5”)。解析时,有时它会给出NumberFormatException。任何帮助都将不胜感激 #set($Integer=0) #if($Integer.parseInt($colspan)>1) //some code here..... #end 为什么不使用VelocityTools项目中的MathTool或NumberTool呢。有没有人能给我举一个用MathTool或NumberTool?context

/$colspan
是字符串中的数字(例如
$colspan=“5”
)。解析时,有时它会给出NumberFormatException。任何帮助都将不胜感激

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

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

有没有人能给我举一个用MathTool或NumberTool?context.put(“math”,new MathTool())解析整数的例子#如果($math.toInteger($colspan)>1)