aspose file tools*
The moose likes JSP and the fly likes Problem displaying database table data in jsp form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem displaying database table data in jsp form" Watch "Problem displaying database table data in jsp form" New topic
Author

Problem displaying database table data in jsp form

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 757
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 ]

Jigar Naik


Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321



Thinking! is this the right way to do in JSP?
[ March 23, 2007: Message edited by: Saif uddin ]

Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 757
I'm not sure,

need some more hint..
Sunil Vasudevan
Ranch Hand

Joined: Mar 05, 2007
Posts: 107
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:



Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem displaying database table data in jsp form