tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Burns" <>
Subject Help: How do I get a specific-indexed item from a collection?
Date Tue, 19 Jul 2005 19:07:35 GMT
I have a Skill object that holds a collection of SkillLevel objects. Using a
JSP, I can pull out all of the SkillLevels from the collection by iterating
over the collection.

However, I want to be able to pull out specific SkillLevel objects. I have a
method on the Skill object: getSkillLevel(int index). 

If the Skill object can be referenced as a bean name "skill", then here is
an example of what I've tried, in an attempt to get the third element from
the collection:

	<c:out value="${skill.skillLevel['2']}"/>

But this gives me an error, something like:
 'Unable to find a value for "skill.skillName" in object ... using operator
"[2]" null'
Unfortunately I do not have access to the computer on which I was running
this earlier, so this is from my memory.

I have tried a number of variations, but hit the same problem.

Could you please help by telling me what is the CORRECT method of achieving
this, please?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message