开发者

JSTL cannot parse a double variable multiplied by an integer variable?

If I set two variables in my controller:

double doubleAmount = 18.0;
int integerAmount = 2;

And then try to multiply them in my JSTL code:

<c:set var="result" value="${doubleAmount} * ${integerAmount}"/>

I get this error:

javax.servlet.Serv开发者_开发技巧letException: 
javax.servlet.jsp.JspException: 
In &lt;formatNumber&gt;, 
value attribute can not be parsed into java.lang.Number: 
"18.0 * 2"

How do I perform this operation in my JSTL code?


Try <c:set var="result" value="${doubleAmount * integerAmount}"/> please.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜