Dear Tiles Dev,
I have a situation where I would like to be able to access the current
definition's name from the jsp / page context is doing the rendering. For
example:
<definition name="my.tile" extends="my.layout" preparer="my.preparer">
<put-attribute name="" value=""/>
</definition>
In the JSP I'd like to be able to do something like this:
<c:out value="${definition.name}"/> <!-- renders "my.tile" -->
I haven't found this functionality anywhere within Tiles, and have been
looking for the best place to add it. The render() methods of
BasicTilesContainer are my current approach, where I'm experimenting with
something like:
private void render(TilesRequestContext request, String definitionName) {
....
Definition definition = getDefinition(definitionName, request);
...
request.getRequestScope().put( "definition", definition );
...
}
(Ideally, I'd like to add it to the pageContext ... )
Would anyone care to comment on the wisdom of using this approach?
Is there an easier way or a more sensible approach?
Thanks and Regards,
Stewart