class VelocityStyleTilesTool extends ContextHolder {

    public Renderable render(final Attribute attribute) {
        return new AbstractDefaultToStringRenderable(getVelocityContext(),
                null, getResponse(), getRequest()) {

            public boolean render(InternalContextAdapter context, Writer writer)
                    throws IOException {
                Request velocityRequest = createVelocityRequest(
                        getServletContext(), writer);
                TilesContainer container = TilesAccess
                        .getCurrentContainer(velocityRequest);
                container.render(attribute, velocityRequest);
                return true;
            }

        };
    }

}