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 Thu, 30 Aug 2012 19:20:34 GMT
On 12-08-30 12:59 PM, Mick Semb Wever wrote:
> My preference is for the first approach, and particularly standardising
> on using Request.class.getName() as the key in foreign contexts.
> 
> But there often isn't a foreign context that is loose enough to put a
> request object into. I would rather have taken the first approach in
> tiles-request-mustache but it doesn't seem possible. Using a ThreadLocal
> should be a frowned upon last-available option to use. 

How about:
    protected Map<String,Object> buildScope(Request request) {
        [...retrieve attributes...]
        scope.put(Request.class.getName(), request);
        return scope;
    }
Wouldn't it fit the bill?

Hope this helps.
Nick

Mime
View raw message