Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display objects values from a List of objects using JSTL  RSS feed

 
Narsimha Reddy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My value object/bean


Arraylist rankingsList contains list of bean object.

I want to display company name,metric value in jsp.
<c:forEach var="rankingsList" items="${rankingsList}" >
<cut value="${rankingsList.companyName}" />
<cut value="${rankingsList.metricValue}" />
</c:forEach>

But i am not able to display companyname and metric value in jsp
I am getting java.lang.NumberFormatException: For input string: "companyName" ERROR.

Could please suggest met some solution.

Thanks in advance.
Narsimha Reddy



[BSouther: Added UBB CODE tags]
[ January 19, 2008: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66182
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extermely hard to read and most people will just go elsewhere. Please read this for more information.

You can go back and change your post to add code tags by clicking the .
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66182
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:forEach var="rankingsList" items="${rankingsList}" >

Why is your var the same as your items? You're over-writing your list.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!