This code used to work fine, but I just overhauled a lot of the underlying Java code and now it no longer works. I have a bean with values:
<c:forEach items="${actionBean.appliedJobs}" var="aJob" varStatus="loop">
${aJob}
</c:forEach>
This prints out: 14513=APPLIED 14535=APPLIED 14515=APPLIED 14514=APPLIED
. appliedJobs is populated in Java as a HashMap<Long, String>
. I also have code that accesses this array using a variable jobId
which is of type Integer.
${jobId} //This prints correctly as 14513
${actionBean.appliedJobs[jobId]} //Prints nothing, is likely null
${actionBean.appliedJobs[14513]} //This prints correctly as APPLIED
The third line in the above block prints fine because 14513 is interpreted as a Long, I think. I'm aware of the Long/Integer jstl issues as described here and here, but the fact that this code used to work is what's throwing me off.
EDIT: For now, I've created a getter() for jobId that returns a Long jobId instead of Integer jobId and that has circumvented the issue, but I'd still like to know the root cause.