wood burning stoves*
The moose likes Servlets and the fly likes Dynamic data population from database and display in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Dynamic data population from database and display in jsp" Watch "Dynamic data population from database and display in jsp" New topic
Author

Dynamic data population from database and display in jsp

Binesh Kochi
Greenhorn

Joined: Nov 29, 2009
Posts: 6
Hi all,

I need to display dynamic data populated from database.Basically its a question answer data.Some time I need to display 10 question and answers and some time more than that based on the query. How to do this and display in JSP page.
I am using Struts 1.4 .

Any help will be highly appreciated.....

Looking forward to your help...

Thanks
Binesh
Shruthi Sam
Ranch Hand

Joined: Jul 09, 2008
Posts: 73
Hi Binesh,

can you please explain your requirements a little clear? you actually need the query for getting the random data from database? or something else?
Binesh Kochi
Greenhorn

Joined: Nov 29, 2009
Posts: 6
Hi Shruthi,
Thanks a lot for your reply.

I am getting results from stored procedures. that part is ok.

but I need to display that results in jsp.

some time i get 10 questions and answers and sometime 5. i need to display that in jsp.

Some questions have more than 3 answers (radio buttons) and some questions have check boxes as answers.


for example

Question A: bla bla bla bla

Ans radio button[value]
radio button[value]
radio button[value]

Question2: bla bla bla

checkbox [value]
checkbox [value]
chekbox [value]


All the check box and radio buttons are dynamically created based ion the query.


I need to display this in a JSP page.

I am confused with how to map this question and answer.....

Thanks







Aditya Keyal
Ranch Hand

Joined: Dec 01, 2008
Posts: 71
Just a quick question. When did we come up with struts 1.4???

And as for your requirement. Retrieve the questions and answers in a List. Preferably create a POJO structure like this:



Now once you retrieve the questions with the correct mapped answers send a List of questions into the JSP. Then assuming you are using struts (1.x) use a nested logic:iterate to actually display the questions and the answers.


- Aditya Webservices Blog
Binesh Kochi
Greenhorn

Joined: Nov 29, 2009
Posts: 6
Its Struts 1.3

Thanks Aaditya.

Binesh Kochi
Greenhorn

Joined: Nov 29, 2009
Posts: 6
Thanks a lot Aditya for your guidance.

lemme try it...................
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Dynamic data population from database and display in jsp
 
Similar Threads
Java and crystal reports: java object as a datasource in crystal reports
Retrieving values from multiple files at a time
TreeView in JSP ?
extracting data from a website by Jsp
How to display 10 most relevant tweets from Twitter in real-time for the keyword "@cldmgc".