Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create a table in the jsp dynamically without knowing the number of columns using struts

 
Thilak Raj Shanmugham
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, am a bit newbie to struts but i could use some help in this....

In my screen the user will have only the table name to select. So the system has to get the table data from the db using the table name and show it on the front end screen.

The challenge am facing is i dont know how many columns that table has so i cant have the Action Form with the setters and getters. So far i have managed to get the column names in a separate list using resultsetmetadata and data in the separate list in the Action class.

My ultimate question is .. how to create a table in the jsp dynamically without knowing the number of columns and display the rows without setters and getters using struts.
 
Joe Ess
Bartender
Pie
Posts: 9258
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what you are asking for is Indexed Properties. Each field's name is an index into a collection. The getters and setters in the action take a collection as an argument. If you search this forum or the web, you'll find plenty of examples.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic