...
Code Block | ||||
---|---|---|---|---|
| ||||
<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 of filters optionally starts with the ActionContextCleanUp filter, followed by the users other desired filters. ThenLastly, the FilterDispatcher handles the request, usually passing it on to the ActionMapper.
WebWork provides extensions to the
Warning | ||
---|---|---|
| ||
If ActionContext access is required within the decorators, the ActionContextCleanUp filter must be placed at the beginning of their filter-chain. This tells the FilterDispatcher when, exactly, to clean-up the request. |
Velocity
If you are using Velocity for your SiteMesh decorators, we recommend not using the WebWorkVelocityServlet or the SiteMeshVelocityServlet. In fact, we don't recommend you use any servlet at all. Instead, try creating a servlet that extends PageFilter and then using that servlet in place of PageFilter in web.xml. In your cusotm servlet, override the applyDecorator() method and then use WebWork's VelocityManager to access your decorator templates. You can use VelocityManager to create a default Context as well, which will include all the WebWork variables such as $stack. Then simply add the Page object to the context and then you can access the page parts using $page.title, $page.body, etc.