Versions Compared

Key

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

Update formatting
Info
titleAbout SiteMesh

...

SiteMesh is a web-page layout and decoration framework and web- application integration framework to aid in creating large sites consisting of many pages for which a consistent look/feel, navigation and layout scheme is required.

(tick) The framework integrates well with SiteMesh "out of the box".

The framework 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 on the stack (or even the ActionContext), you can do so by using the normal tag libraries that come with WebWorkthe framework. That's it!

ActionContextCleanUp

In WebWorkUnder the framework'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 to provide SiteMesh integration. This The clean-up filter tells the FilterDispatcher dispatcher filter exactly when exactly, to clean-up to remove obsolete objects from the request. Otherwise, the ActionContext may be removed before the decorator attempts to access it.

Warning
titleWarningOrder Matters

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

...

Info
titleJavadoc: (org.apache.struts.action2.dispatcher.ActionContextCleanUp)
Wiki Markup
{snippet:id=description|javadoc=true|url=com.opensymphony.webwork.dispatcher.ActionContextCleanUp}

Velocity and FreeMarker Decorators

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

Velocity

The VelocityPageFilter extends the SiteMesh PageFilter to allow direct access to framework variables such as $stack and $request.

In the web.xml, the VelocityPageFilter should be placed 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 }}.

FreeMarker

The FreeMarkerPageFilter extends the SiteMes PageFilter to allow direct access to framework variables such as $stack and $request.

Wiki Markup
{snippet:id=example.velocity.filter.chain|javadoc=false|lang=xml|url=https://webwork.dev.java.net/source/browse/*checkout*/webwork/webapps/showcase/src/webapp/WEB-INF/web.xml?content-type=text%2Fplain}

FreeMarker

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

Info
titleJavadoc: (example.freemarker.filter.chain)
Wiki Markup
{snippet:id=example.freemarker.filter.chain|javadoc=false|lang=xml|url=https://webwork.dev.java.net/source/browse/*checkout*/webwork/webapps/showcase/src/webapp/WEB-INF/web.xml?content-type=text%2Fplain}