> -----Original Message----- > From: Erik Hatcher [mailto:[EMAIL PROTECTED] > > Could you share an example of using an alias in this manner to > kick-start me some here? >
I'm not sure how detailed you want, but... Lets say you have an Action named EditFooAction.java. You could have an EditFooAction-validation.xml with one Field validator, a Required validator on an Integer property named "id". This action could be mapped in the xwork.xml with 2 aliases, "editFoo" and "saveFoo" with corresponding methods "editFoo" and "saveFoo" on the Action. In this case, you wouldn't have any extra validations applied for the "editFoo" alias, while for the "saveFoo" alias, you would validate all of the fields of a "Foo" object. This way, you can re-use the common pieces, having an "id" property and a "Foo" object (either returned from getModel() or getFoo(), if you want to access your properties as "foo.bar") and they can share the same Foo edit form. > > A few other questions about WebWork: > > - Is the Action interface going away? Mike axed it over the > weekend, locally, but what's the verdict? > Yep, I think that's pretty likely, but it's good to discuss it here. > - How do you use other methods other than execute() in an Action? You set the method="commandMethod" attribute in the <action> element in xwork.xml. Check out the xwork.xml in the root of the test source under Xwork. It tests all of the functions and pieces of xwork.xml. > > - I still haven't fully grasped xwork.xml yet. What do > "packages" > do and how/why would I use them (let's keep this web-app specific so > its more concrete for the sake of discussion)? > It allows you to do a couple of things: 1) Apply a namespace to a set of actions 2) Apply package globals to a set of actions, such as global-results 3) Define interceptors for a group of actions 4) Inherit these settings from another package 5) Create a reusable sub-app by bundling a config file, a set of Action classes, and a set of velocity templates into a Jar file and use the <include file="include.xml"/> to load it from the classpath > - Namespaces - this looks like what I need to do in order to > isolate sections of our app ("/profile", "/events", etc) and > keep them > consolidated in one spot. Nice. I'll give this a try. > Yep. This allows the actions to be easily secured, as well. > - Interceptor stacks - I see the debugStack in there. > How would I go > about using it? I'm assuming I just add an <interceptor-ref> > element > to the actions I wanted, or to the defaultStack to apply to all > actions, right? The defaultStack is not applied unless you want it to be. Check out the xwork.xml in the test source tree under Xwork. You apply interceptors and interceptor stacks the same way, via an interceptor-ref with the name. You can also apply a defult interceptor ref for a package using this notation in your xwork.xml under a package: <default-interceptor-ref name="timer" /> Which will be applied to all actions in a package which don't have any interceptor refs. > > The wiki has been immensely helpful. Once I get all the > pieces to my > proof-of-concept app. completed I'll add some of what I learn > back to > it (the validation page, particularly, needs a bit more info > to really > make it work). > > Erik > Ok, sounds great! ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork