This might not be related, but I like the way Jason does it, and its the way 
I'd like to do it as well, especailly since I learn that foo!bar is going to 
get deprecated.

----- Original Message ----
From: Jason Carreira <[EMAIL PROTECTED]>
To: dev@struts.apache.org
Sent: Wednesday, 26 July, 2006 11:22:41 AM
Subject: Re: Returning Result directly (was Re: DefaultActionMapper compatablity

> Could you give an example how multiple mappings for a
> single action is 
> used with common CRUD actions?
> 
> Don

Ok, here's what our Invoice CRUD action mappings look like:

<action name="listInvoice" 
class="com.eplus.app.invoice.action.InvoiceCrudAction" method="list">
                <interceptor-ref name="listStack"/>   
            <result name="CRUD-list" 
type="freemarker">/template/eplus/metaDataList.ftl</result>
          </action>
          <action name="editInvoice" 
class="com.eplus.app.invoice.action.InvoiceCrudAction">
              <interceptor-ref name="editStack"/>
          </action>
          <action name="saveInvoice" 
class="com.eplus.app.invoice.action.InvoiceCrudAction" method="save">
              <interceptor-ref name="crudStack"/>
          </action>
          <action name="deleteInvoice" 
class="com.eplus.app.invoice.action.InvoiceCrudAction" method="delete">
            <interceptor-ref name="crudStack"/>          
          </action>



A better example of reusing the same action with the same method several times 
is our DomainObjectLister. We're still working out the entity meta-data we've 
been building, so I foresee this continuing to evolve, but it's pretty simple 
already. In the future you'll just need to configure it with the domain type. 

<action name="getVendorRelationships" 
class="com.eplus.lib.web.action.DomainObjectLister">
            <param 
name="domainClass">com.eplus.biz.catalog.mgmt.model.VendorRelationship</param>
            <param name="visibleFields">vendor.name</param>
            <param name="idField">id</param>
            <param name="sortColumn">vendor.name</param>
            <result name="success" 
type="freemarker">/template/eplus/lists/domainObjectTable.ftl</result>
        </action>            
        <action name="getBuyerCatalogs" 
class="com.eplus.lib.web.action.DomainObjectLister">
            <param 
name="domainClass">com.eplus.biz.catalog.mgmt.model.BuyerCatalog</param>
            <param name="visibleFields">name,description</param>
            <param name="idField">id</param>
            <param name="sortColumn">name</param>
            <result name="success" 
type="freemarker">/template/eplus/lists/domainObjectTable.ftl</result>
        </action>
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=38338&messageID=75787#75787


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Reply via email to