如果我在 Controller 中设置两个变量:
double doubleAmount = 18.0;
int integerAmount = 2;
然后尝试在我的 JSTL 代码中将它们相乘:
<c:set var="result" value="${doubleAmount} * ${integerAmount}"/>
我收到此错误:
javax.servlet.ServletException:
javax.servlet.jsp.JspException:
In <formatNumber>,
value attribute can not be parsed into java.lang.Number:
"18.0 * 2"
如何在 JSTL 代码中执行此操作?
最佳答案
尝试<c:set var="result" value="${doubleAmount * integerAmount}"/>
请。
关于java - JSTL 无法解析双变量乘以整型变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5888152/