Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic data population from database and display in jsp

 
Binesh Kochi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Binesh Kochi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its Struts 1.3

Thanks Aaditya.

 
Binesh Kochi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Aditya for your guidance.

lemme try it...................
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic