File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes how to create a table in the jsp dynamically without knowing the number of columns using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to create a table in the jsp dynamically without knowing the number of columns using struts" Watch "how to create a table in the jsp dynamically without knowing the number of columns using struts" New topic
Author

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

Thilak Raj Shanmugham
Greenhorn

Joined: Nov 29, 2012
Posts: 1
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

Joined: Oct 29, 2001
Posts: 8877
    
    8

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to create a table in the jsp dynamically without knowing the number of columns using struts