« Return to Thread: http://struts.apache.org/dtds/struts-2.0.dtd needs to be updated

Re: http://struts.apache.org/dtds/struts-2.0.dtd needs to be updated

by matt.payne :: Rate this Message:

Reply to Author | View in Thread


Never mind the "default-class-ref" is completely useless if there is not a way to indicate that the actions should be constructed with this class substituted.


With this setup.
<package name="Abstract-crud" extends="myDefault" abstract="true">
  <!--  edit is often used as the create/view -->
                <action name="edit" >
                        <result name="input" type="velocity">edit.vm</result>
                        <result name="success" type="velocity">edit.vm</result>
                        <result name="error" type="velocity">edit.vm</result>
                </action>
                <action name="save" >
                        <result name="input" type="velocity">edit.vm</result>
                        <result name="success" type="chain">list</result>
                        <result name="error" type="velocity">edit.vm</result>
                        <result name="cancel" type="redirect">list.action</result>
                </action>
                <action name="list" method="list">
                        <result name="success" type="redirectAction">list</result>
                </action>
                <action name="delete" method="delete">
                        <result name="success" type="redirectAction">list</result>
                </action>

        </package>
       
        <package name="Example" extends="Abstract-crud" namespace="/example">
                 <default-class-ref class="org.ExampleAction" />
        </package>

Despite org.ExampleAction having a list method, invoking /example/list.action

throws --->

com.opensymphony.xwork2.ActionSupport.list()

RequestURI=/quartz/jobs/definition/list.action
Caused by:

java.lang.NoSuchMethodException: com.opensymphony.xwork2.ActionSupport.list()

I expected my action would be substituted.  I am assuming this this behavior is broken is default-class-ref hasn't been well exercised in the wild.

Still looking for a wildcard/template solution that would allow use of packageName from the wildcard.

Matt

 « Return to Thread: http://struts.apache.org/dtds/struts-2.0.dtd needs to be updated