Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Packages are a way to group Actions, Results, Result Types, Interceptors and Stacks into a logical configuration unit that shares a common configuration. Packages . Conceptually, packages are similiar to objects in that they can be extended and have individual parts overridden by "sub" packages.

Packages

The package element has one required attribute, "name", which acts as the key for later reference to this package. The "extends" attribute is optional and allows one package to inherit the configuration of one or more previous packages including all interceptor, interceptor-stack, and action configurations.

(warning) Note that the configuration file is processed sequentially down the document, so the package referenced by an "extends" should be defined above the package which extends it.

The "optional abstract" optional attribute allows you to make a package abstract, which will allow you to extend from it without the action configurations defined in the abstract package actually being available at runtime attribute creates a base package that can omit the action configuration.

Attribute

Required

Description

name

yes

key to for other packages to reference

extends

no

inherits package behavior of the package it extends

namespace

no

see Namespace Configuration

abstract

no

declares package to be abstract (no action configurations required in package)

Sample usage of packages in

...

action.xml

Wiki Markup
{snippet:id=xworkSample|javadoc=false|lang=xml|url=/webwork/webapps/showcase/src/webapp/WEB-INF/classes/xwork.xml}