Use c:set to set a non-string value

el, jsf, jstl, type-conversion

Solution

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}"/>

Problem

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?

Original source

Related problems