Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
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}" >
<c:out value="${rankingsList.companyName}" />
<c:out 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 ]
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic