Whenever doing <c:set var="name" value="1"/>
, #{name}
is always a String as evidenced by #{name.class}
.
Is there any way to in a JSF/Facelets context to set a scoped attribute that is an Integer or Long literal value?
EL has Automatic Type Conversion. This article has some good information. However, the short of it is that you shouldn't care. You should be able to do things like the following as long as param.month is, in fact, an Integer.
<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}"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With