aspose file tools*
The moose likes Struts and the fly likes Passing information from a Action class to a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Passing information from a Action class to a JSP" Watch "Passing information from a Action class to a JSP" New topic
Author

Passing information from a Action class to a JSP

Brian Egger
Greenhorn

Joined: Aug 04, 2004
Posts: 11
hello I am trying to pass a ResultSet from an ActionClass into a JSP. But I would prefer not to use the request.setAttribute(). Is there a way someone can point me to research. I tied using the ActionForm but for some reason whenever I call it from the JSP it is null. I figured this was because I am not submitting a form to it. Any suggestions would be appreciated.

Thanks
s penumudi
Ranch Hand

Joined: Nov 17, 2004
Posts: 113
Did you have setResultSet() and getResultSet() with a private variable resultset in your ActionForm.

how did you set your resultset to the ActionForm?
Did you use setResultSet() method.

If all above steps are done, then I guess you should be able to get the result by calling getResultSet() from your JSP.

Other solution would be to hold the resultset in session scope.

Hope this helps.
Brian Egger
Greenhorn

Joined: Aug 04, 2004
Posts: 11
yeah there is a Getter and Setter, I pass it to the form as a Collection of ValueObjects which all have getter and setter methods appended to them. When I send it in the request.getParameter() it sees it fine, and I can iterate through the Collection, but when I put the Collection inside the form it never comes through. I guess I will just keep it in the request.

Thanks for the Help
Brian
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Passing information from a Action class to a JSP