• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Problem displaying database table data in jsp form

 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, (hope this is a jsp question.)

I'm using mvc architecture, and i have created one jsp which list the all data of my database table.

following is my Servlet which will call the model.java's funtion which returns ArrayList contaning all the data and than servlet forwards ArrayList to my JSP

ControllerServlet.java code


Model.java



and following is my jsp code which disply my database table data... which is in arraylist



The problem i'm facing is when my jsp get rendered my contactList is null, is there any way out to overcome this problem. And if i'm using wrong technique than what is the right way to display table data ???

Looking for standard/genuine solution...
[ March 23, 2007: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Thinking! is this the right way to do in JSP?
[ March 23, 2007: Message edited by: Saif uddin ]
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure,

need some more hint..
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure that your query fired on the database server returns any records?

The following:

will just skip the loop if no results are fetched in the query. No exception is thrown if the resultset is empty.

Instead, have the following logic:

 
get schwifty. tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic