tiles-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas LE BAS <m...@nlebas.net>
Subject Re: Implementing Tiles Request (2/3): Calling an alien API
Date Fri, 31 Aug 2012 14:14:02 GMT
On 12-08-31 02:53 AM, Mck wrote:
> It's actually the resource loading functionality that i'm after in an
> override of DefaultMustacheFactory.getReader(String path).

The resource loading itself goes through ApplicationContext, and is
unrelated to the Request instance or to the tiles-framework in any way.

> This is tiles-framework code, where a path can be interpretted as a
> tiles attribute name and so from the request i can obtain the
> attributeContext and then do the resource loading.

So you want to map {{>body}} into <tiles:insertAttribute
name="body"/>... while MustacheFactory has no knowledge of any
Request-related object (which sounds normal since DefaultMustacheFactory
is basically the template compiler, not the template itself).

I suppose the way to do it as intented by the author of mustache is to
create a new subclass of PartialCode in a subclass of
DefaultMustacheVisitor like they do in DeferringMustacheFactory. There
you would have access to everything.
It's some extra work at coding, but it doesn't interfere with the
loading of the initial template, so the testing and debugging should be

Hope this helps,

View raw message