• 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

Dynamic data population from database and display in jsp

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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







 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its Struts 1.3

Thanks Aaditya.

 
Binesh Kochi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Aditya for your guidance.

lemme try it...................
 
This is my favorite 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