org.apache.tiles.extras.renderer
Class OptionsRenderer
java.lang.Object
org.apache.tiles.extras.renderer.OptionsRenderer
- All Implemented Interfaces:
- org.apache.tiles.request.render.Renderer
public final class OptionsRenderer
- extends Object
- implements org.apache.tiles.request.render.Renderer
Provides a custom "options" syntax for attributes.
The first option that can be rendered is.
Comes from http://tech.finn.no/the-ultimate-view/
Actual rendering is delegated to the TypeDetectingRenderer that's supplied in the constructor.
For example:
"/WEB-INF/tiles/fragments/${options[myoptions]}/content.jsp"
given the myptions list-attribute is defined like:
will look for content.jsp
first in "/WEB-INF/tiles/fragments/car/" then
second in "/WEB-INF/tiles/fragments/vechile/" and
last in "/WEB-INF/tiles/fragments/advert".
Currently only supports one occurrance of such an "option" pattern in the attribute's value.
Constructor Summary |
OptionsRenderer(org.apache.tiles.request.ApplicationContext applicationContext,
org.apache.tiles.request.render.Renderer renderer)
|
Method Summary |
boolean |
isRenderable(String path,
org.apache.tiles.request.Request request)
|
void |
render(String path,
org.apache.tiles.request.Request request)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OptionsRenderer
public OptionsRenderer(org.apache.tiles.request.ApplicationContext applicationContext,
org.apache.tiles.request.render.Renderer renderer)
isRenderable
public boolean isRenderable(String path,
org.apache.tiles.request.Request request)
- Specified by:
isRenderable
in interface org.apache.tiles.request.render.Renderer
render
public void render(String path,
org.apache.tiles.request.Request request)
throws IOException
- Specified by:
render
in interface org.apache.tiles.request.render.Renderer
- Throws:
IOException
Copyright © 2001-2012 Apache Software Foundation. All Rights Reserved.