This week's book giveaway is in the Open Source forum.
We're giving away four copies of Programmers Guide to Apache Thrift and have Randy Abernethy on-line!
See this thread for details.
Win a copy of Programmers Guide to Apache Thrift this week in the Open Source 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

List pointer value is getting printed instead of data  RSS feed

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've the below DAO File.



And the below Servlet



Here i'm trying to print the first value (caseNumber) in a jsp textbox using the below code.



But the output i getting is as below



but instead of this i need the exact value at there. please let me know where am i going wrong and how do i fix it.

Thanks,
Sunny
 
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you meant to display just the first item or all the records in the list?

If the latter, better to use the <c:foreach> to loop through the list.
 
Sheriff
Posts: 67257
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why use toString() rather than a getter (accessor) that gives you the value that you want?
 
Rakesh Keerthi
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

K. Tsang wrote:Are you meant to display just the first item or all the records in the list?

If the latter, better to use the <c:foreach> to loop through the list.



Hi Tsang, I don't want to retrieve all the values, i want only the first value to be retrieved.
 
Rakesh Keerthi
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Why use toString() rather than a getter (accessor) that gives you the value that you want?



Hi Bear,

Thanks for this tip. I did it (using below) and got the result as expected.



Thanks Again
:beerchug:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!