Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying Dynamic Tables  RSS feed

 
Drew Lane
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone have a code snippet for displaying dynamic tables in a JSP page. I'm pulling some information out of a mysql database, and the result set may be different each time the page is displayed.
I just want to display 2 columns by x number of rows.
I've got some code I made up, but it's kinda messy and was wondering if there was a simpler way to do this. Servlet? Bean? Tag Lib?
Thanks!
Drew
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make a bean to hold the contents to show on the web.

Make a bean for each unik databean (this could be the only bean used)

In a Servlet do this:

The build of the bean could be done in another bean used by the Servlet.
In the JSP page:

/Rene
[ June 29, 2002: Message edited by: Rene Larsen ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!