Dashboard > XWork > Documentation > XWork package
  XWork Log In View a printable version of the current page.  
  XWork package
Added by tm_jee, last edited by tm_jee on Oct 14, 2006  (view change)
Labels: 
(None)

XWork2 introduce the notion of package to group related action under the same namepsace. Its much like how java package being used to group related class. Just that XWork2 package supports multiple inheritance.

Namespace

XWork2 package defines the namespace its containing action is under. Without this attribute specified, the action will be automatically considered to be under the default (empty) namespace.

<xwork>
   ...
   <package name="default" namespace="/myNamespace">
     ...
   </package>
   ...
 </xwork>

Abstraction

An action can be abstract, meaning that it will not be recognized by XWork2 but it does exists. This mean to identify action whose sole purpose tends to be a convenience for other action to subclass.

<xwork>
   ...
   <package name="default-abstract" abstract="true">
     ...
   </package>

   <package name="default" extends="default-abstract">
     ...
     <!-- more specific action here.  -->
   </package>
   ...
 </xwork>

Extendability

XWork2 action support inheritance such that an action could extend form anohter parent action. XWork2 action could extends off multiple action. The extending action will inherit all its parent package
s action, interceptor, result-types etc.

<xwork>
   ...
   <package name="default" namespace="/myNamespace" extends="parent1-default, parent2-default">
     ...
   </package>
   ...
 </xwork>

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators