Versions Compared

Key

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

...

One thing to note is when you want to pass a value from a decorated page to a decorator using the <ww:set> tag, you need to specify a scope (request, session, application) if the decorated page is invoked directly (not a result of an action). By default if no action has been executed and no scope was specified, the set value will only availlable from the same PageContext. Look here for more information.

Localization

WebWork provides easy to use i18n functionality to SiteMesh decorators. Now using the <ww:text/> tag works seemlessly. In the event where you need to reference an i18n string, use the id attribute as documented in the Text tag. An example of such situation is given below.

Typically embedding i18n in to form elements would be done using the following:

...


<ww:textfield label="%{getText('com.acme.login.text')}" name="login"/>

However, due to the way WebWork and SiteMesh work, you would need to seperate the above code in to two tags.

...


<ww:text id="login" name="com.acme.login.text"/>

<ww:textfield label="#login" name="login"/>

Custom Decorators

In WebWork's Architecture, the standard filter-chain optionally starts with the ActionContextCleanUp filter, followed by other desired filters. Lastly, the FilterDispatcher handles the request, usually passing it on to the ActionMapper. The primary purpose of the ActionContextCleanUp is for SiteMesh integration. This tells the FilterDispatcher when exactly, to clean-up the request. Otherwise, the ActionContext may be removed before the decorator attempts to access it.

...