Two Laptop Bag
The moose likes Struts and the fly likes Iterate tag HELP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Iterate tag HELP" Watch "Iterate tag HELP" New topic

Iterate tag HELP

Matthew Vincent

Joined: May 01, 2003
Posts: 8
What is the best architecture to query a database, get the results, and display to the user?
I do not need help with the paging logic.
I have a view (JSP page) that an end user types a query into a textarea. Let's call it query.jsp. This submits the query to an ActionForm ( which validates the data. This is then "forwarded" on by the Struts framework to the Action class ( Currently, the QueryAction class calls another class from which it gets an ArrayList of Strings which contains the names of the columns. The "data" is also retrieved from this class as a 2 dimensional ArrayList. I have no problems of iterating over the columns using the following:

However, I am having problems iterating over the "rows". Is this the best solution? What other solutions are there? Does anyone have a working example of this? I am getting confused of where the beans should be and how I should be accessing them.
I saw the posting here, but I wasn't sure of how to set things up (strut-config.xml, etc.) Thanks for any help you can provide.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

I think you might have more success in the Struts forum with this one. I'll move it.
I agree. Here's the link:
subject: Iterate tag HELP
It's not a secret anymore!