【发布时间】:2011-09-11 22:34:04
【问题描述】:
如何让promoPrice 变量作为字符串ONLY $4.67 的一部分打印?
<c:set var="promoPrice" value="4.67" />
<p>${(promoPrice != null) ? "ONLY $${promoPrice}" : "FREE"}</p>
【问题讨论】:
-
我的建议解决了您的问题吗?即将 $promoPrice 移到引号之外。
-
@rationalSpring 不,这不起作用。我猜你不能那样传递变量。不过还是谢谢。
标签: jsp jstl el string-concatenation