Gre*_*nie 6 jsf jstl el type-conversion
无论什么时候<c:set var="name" value="1"/>,#{name}总是一个字符串,如下所示#{name.class}.
有没有办法在JSF/Facelets上下文中设置作为Integer或Long文字值的作用域属性?
EL 具有自动类型转换功能。这篇文章有一些很好的信息。然而,缺点是你不应该关心。只要 param.month 实际上是一个整数,您就应该能够执行以下操作。
<c:set var="myInteger" value="${param.month}"/>
<p>
The value of myInteger is:<c:out value="${myInteger}"/>
Perform a multiplication operation to show that the type is correct:
<c:out value="${myInteger *2}"/>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26372 次 |
| 最近记录: |