You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by douglas reames <do...@hotmail.com> on 2003/06/10 19:19:20 UTC

Best Practice: Where to? How to? store Value Objects

Hi,
I am attempting to extend ARTIMUS to see how I might 'architect' a struts 
app that gives the user output alternatives:  wap, excel spreadsheet, pdf...

In Struts-Config, the RenderPDF ActionMapping: [ A ] retrieves data from 
mysql with org.apache.struts.scaffold.ProcessAction, and [ B ] provides 
ActionForward with a path to a class RenderPDF that extends 
org.apache.struts.scaffold.BaseAction.  [ C ] RenderPDF creates JDOM 
document by referencing the Value Object created in step [ A ].  ( SEE 
excerpt below. )

How do I save the Value Object bean , so that it can be subsequently 
retrieved downstream by the RenderPDFAction?

NOTE:  when I attempt to follow the ARTIMUS::RenderRss::executeLogic method 
code - I presummed ( probably incorrectly ) that the value for 
'Tokens.LIST_KEY' was being set by struts "under the hood":

ResultList result   = (ResultList) request.getAttribute(Tokens.LIST_KEY);

result is Null

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"/>

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org