This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have been working on something for hours and I hope someone can help. I have a List of Map objects that I am trying to access in my JSP. I am using Struts. The List defined in my Action class looks like this:
Nothing I have tried is working. I wanted to populate a table, but I have finally given up and stripped the code down to what follows. I just wanted to see if I could access the table, so I coded the following in my JSP:
According to different examples I found the code should work, but my HTML page shows up blank. What am I missing?
By the way, I displayed the data in the table before I issued the retun, so I know there is data in the table.
Okay, I found the error of my ways. I displayed the contents of the list in a class called by my action (as opposed to displaying right before issuing the return). For whatever reason I returned null back to the action instead of the List. Now that the mystery is solved, I am wondering how to accomplish what I really need to accomplish. I get the following results when I execute the jsp in my original question:
The keys can vary from request to request because the user can select which fields to display on the report. So, I would like the column headers to be based on the the key fields and the rows to be based on the values. The output should look like:
messageId claim code node id
02c54758b 123456 040 Blue TEST999999999
02c54758c 123789 040 Blue TEST999999999
Any advice on the best way to make the above happen?
Joined: Mar 27, 2010
Someone sent me the solution I was looking for, so I am posting it just in case someone else has the same question.