It's not a secret anymore!*
The moose likes Struts and the fly likes Help with Display Tag in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help with Display Tag in Struts " Watch "Help with Display Tag in Struts " New topic
Author

Help with Display Tag in Struts

Liana Daughtry
Greenhorn

Joined: Mar 27, 2010
Posts: 13
Hi,

I am working on a test app trying to learn Struts and other JAVA components. My App is working and it's sole purpose is to produce a report (HTML table). One one the things I'd like to experiment with is to give the user the option to export the HTML table to an Excel document. I have seen a lot of examples, but none seem to fit my situation. My current JSP that will display the report in HTML is below. I would like to know if there is a way I can access the MsgDetail object and build a table using the Display tags.

Note: I wrote this JSP before I knew anything about logic and bean tags in case you are wondering. I have seen cleaner methods I could have used. Nevertheless, I am hoping this code is salvageable.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What doesn't displaytag do that you want it to?

(Note that this is not Struts-specific at this point.)
Liana Daughtry
Greenhorn

Joined: Mar 27, 2010
Posts: 13
I just don't know how I should go about using the Display Tags to access the arraylist that is referenced by the errmsgArr attribute.
<% ArrayList errList = (ArrayList) request.getAttribute("errmsgArr");
MsgDetails tempd = (MsgDetails)errList.get(i);

I wasn't sure if I was going to have to add some logic for a new action or form which is why I posted the question in the Struts forum. Right now my action is forwarding to the JSP page below. The errmsgArr is not stored in an action form. It is just a java bean. Would another forum be more suitable?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Yes, if you're asking DisplayTag questions.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help with Display Tag in Struts