<default-class-ref> sets what class will be used when an <action> tag doesn't include a class="" attribute. I use it to substitute my BaseAction for the default Action implementation, so that I can easily handle Authentication/Authorization without having to specify the class attribute on every action. Not the hugest win in the world, but it saves some typing on larger projects. (*Chris*)
On Jan 10, 2008 12:08 PM, matt.payne <[EMAIL PROTECTED]> wrote: > > > 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 > -- > View this message in context: > http://www.nabble.com/http%3A--struts.apache.org-dtds-struts-2.0.dtd-needs-to-be-updated-tp14742352p14742757.html > > Sent from the Struts - Dev mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
