Start New Discussion Reply to this Discussion Loading comments from a databse on page load
I have a jsp page which has post comment box. I have written a servlet which takes a comment from the text area for the comment box and writes the comment to the database and redirects all the comments stored in the database to the page for display(using request dispatcher). The new comment displays along with all the previous comments. I want to have a functionality where the previous comments are displayed on page load by connecting it to the database . How can I accomplish this.
Related Article: Create HTML page using java
is a solved Java discussion thread by androidf that has 2 replies, was last updated 1 year ago and has been tagged with the keywords: excel, export, html, information, java.
rohit_static
Newbie Poster
6 posts since May 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
if you already have a page that displays all the comments then the question is not "how" but "where" no?
simply reuse that code in the first page! :)
unless im not understanding right what you were saing in your question, but anyways.
In your page, simply have a section call the database functions to execute a SELECT statement on all comments, then loop through the comments and display them in your page!
Philippe.Lahaie
Posting Whiz
360 posts since Oct 2007
Reputation Points: 103
Solved Threads: 54
Skill Endorsements: 4
© 2013 DaniWeb® LLC
Page generated in 0.0548 seconds
using 2.71MB