Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I access the Apache Tiles definition name inside a ViewPreparer?

Is it possible to access the Apache Tiles definition name inside a ViewPreparer?

like image 345
blank Avatar asked Apr 10 '12 11:04

blank


People also ask

What is preparer in java?

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.

What is the use of tiles view?

Tile View allows you to use HTML and CSS markup to set up tile templates.

What are Apache Tiles for?

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.


1 Answers

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>
like image 73
mck Avatar answered Oct 22 '22 18:10

mck