Versions Compared

Key

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

...

Integrating WebWork with SiteMesh is amazingly simple: you don't have to do anything in fact. WebWork stores all its value stack information in the request attributes, meaning that if you wish to display data that is in the stack (or even the ActionContext) you can do so by using the normal tag libraries that come with WebWork. That's it!

ActionContextCleanUp

Wiki Markup
{snippet:id=description|javadoc=true|url=com.opensymphony.webwork.dispatcher.ActionContextCleanUp}

Velocity and FreeMarker 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.

Warning
titleWarning

If ActionContext access is required within the decorators, the ActionContextCleanUp filter must be placed at the beginning of the filter-chain.

For more information, see the javadocs of the ActionContextCleanUp filter:

Wiki Markup
{snippet:id=description|javadoc=true|url=com.opensymphony.webwork.dispatcher.ActionContextCleanUp}

Velocity and FreeMarker Decorators

WebWork provides extension of the SiteMesh PageFilter that assist with integration with Velocity and FreeMarker. We strongly recommend using these filters, instead of the support provided by SiteMesh, because they also will provide the standard variables and Tags that you are used to when created views in your favoriate template language.

Velocity

If you are using Velocity for your SiteMesh decorators, we recommend using the VelocityPageFilter. This is an extension of the SiteMesh PageFilter, which should be placed in the web.xml in between the ActionContextCleanUp and the FilterDispatcher. Now the Velocity decorators will have access to WebWork variables such as $stack and $request.

...