When I create an entry in a map with the key 330707, it is interpreted as a String. However, when I retrieve an entry in a map with the key 330707, it is interpreted as a Number. <jsp:useBean id="franchiseShortName" class="java.util.HashMap" type="java.util.Map" /> <c:set target="${franchiseShortName}" property="${330707}" value="SLP" /> <c:out value="${franchiseShortName[330707]}" /> Doesn't Work! <c:out value="${franchiseShortName['330707']}" /> Works!
Nick, With the following statement: <c:set target="${franchiseShortName}" property="${330707}" value="SLP" /> The value ${330707} evaluates to an integer. However, the target type for 'property' is a String. So the integer is converted to a String transparently. This is why to retrieve the value, one must use the following expression: franchiseShortName['330707'] Now, if you try franchiseShortName[330707] this does not work because 330707 evaluates to an integer that is boxed into an Integer, which does not result as the key for any entry into the map. And if you try franchiseShortName.330707 This fails because 330707 is not a valid Java identifier. Hope this helps, -- Pierre