I am attempting to create a struts app that: [1] queries a data layer, [2] saves Business Bean ( ResultSet ) to Session context and, [3] based on passed parameters, gives the user output alternatives: wap, excel spreadsheet, pdf...
In Struts-Config, the Sub-Use Case - "Output to PDF Document" - realized by '/pdf/Article' and '/pdf/Render' Actions: [ A ] retrieves data from mysql with org.apache.struts.scaffold.ProcessAction, [ B ] provides a "Success" ActionForward with a path to a class RenderPDF, and [ C ] RenderPDF creates JDOM document by referencing the Business Bean created in step [ A ], and [ D ] JDOM Document is transformed to PDF format and output. ( SEE excerpt below. )
[ 1 ] How do I access the Business Bean (ResultSet ) ,in the RenderPDF class?
When I print Session Objects to the container log from the RenderPDF class, I know that it can see the Business Bean - "FindByArticle":
2003-06-11 16:43:04 action: key: result_list
2003-06-11 16:43:04 action: value: [EMAIL PROTECTED]
However, I can not:
[ A ] reference it as a org.apache.scaffold.util.ResultList ( result is NULL):
ResultList result = (ResultList) request.getAttribute(Tokens.RESULT_LIST);
[ B ] reference it as a org.apache.scaffold.util.ProcessBean (result is NULL):
Bean result = (Bean) request.getAttribute(Tokens.RESULT_LIST);
[ C ] use the java reflection package to find out what this object is - [EMAIL PROTECTED] - so that I can call the correct methods on it to get at its contents:
Class beanClass = result.getClass(); //this produces an exception
[ 2 ] If you do not have a suggestion on accessing , can you maybe give me a troubleshooting idea?
Thank you for your time. Regards, Douglas Reames
<!-- Render an article as PDF file --> <action path="/pdf/Article" type="org.apache.struts.scaffold.ProcessAction" parameter="org.apache.artimus.article.FindByArticle" name="articleForm" scope="request" validate="false"> <forward name="success" path="/do/pdf/Render"/> </action>
<!-- Render result as PDF file --> <action path="/pdf/Render" type="org.apache.artimus.struts.RenderPdfRms"/>
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]