[ http://issues.apache.org/struts/browse/WW-1347?page=comments#action_37853 
] 
            
Ted Husted commented on WW-1347:
--------------------------------

> In what way do you see adding an "extends" attribute helping an application 
> that can't be done with packages?

Say, I'm trying to do away with the ! notation,and I have an action stanza like 
this: 

        <action name="Logon" class="mailreader2.Logon">
            <result name="input">/pages/Logon.jsp</result>
            <result name="cancel" type="redirect-action">Welcome</result>
            <result type="redirect-action">MainMenu</result>
            <result name="expired" type="chain">ChangePassword</result>
            <exception-mapping
                    
exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
                    result="expired"/>
            <interceptor-ref name="guest"/>
        </action>

With wildcards, I can change the first line to read: 

        <action name="Logon!*" class="mailreader2.Logon" method={1}>

and the old aliases will work just fine. Except for the default execute method. 
To invoke the execute method, we need to use a URI like "Logon!execute", or 
repeat the stanza. 

With extends we could keep the original element as is and just add 

        <action name="Logon!*" extends="Logon" method={1}  />

If we didn't like wildcards for some reason, with extends we could specify 
exactly with methods to expose.

        <action name="Logon!delete" extends="Logon" method="delete"  />

        <action name="Logon!copy" extends="Logon" method="copy"  />

We could also override some of the alias action mappigs, if needed.

        <action name="Logon!delete" extends="Logon" method="delete"  >
            <result name="cancel" type="redirect-action">Welcome</result>
        </action>

I think one reason people dislike declarative configurations is because we 
don't try hard enough to ensure that we can "say it once" in XML. 

-Ted.




> SAF1 Features to Implement
> --------------------------
>
>                 Key: WW-1347
>                 URL: http://issues.apache.org/struts/browse/WW-1347
>             Project: Struts 2
>          Issue Type: Task
>          Components: Documentation
>            Reporter: Ted Husted
>         Assigned To: Don Brown
>             Fix For: 2.0.0
>
>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to