Is it possible to access the Apache Tiles definition name inside a ViewPreparer?
A View Preparer is simply a class that implement the ViewPreparer interface. The execute method allows to execute code before a definition is rendered. You can extend the ViewPreparerSupport class to avoid compiling problems in the case the ViewPreparer interface changes.
Tile View allows you to use HTML and CSS markup to set up tile templates.
Apache Tiles is a template composition framework. Tiles was originally built to simplify the development of web application user interfaces, but it is no longer restricted to the JavaEE web environment. Tiles allows authors to define page fragments which can be assembled into a complete page at runtime.
just add the attribute into the xml, eg
<definition name="t.*" extends="t.container">
<put-attribute name="body" value="/WEB-INF/jsp/{1}.jsp"/>
<put-attribute name="title" expression="${song.title} - ${song.author} in ${jukebox.name}"/>
<put-attribute name="view" value="t.{1}"/>
</definition>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With