• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

List pointer value is getting printed instead of data

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic