context.setMainResource(resource);
context.getRequest().setAttribute("script",
RenderService.getInstance().resolveScript(resource, context));
// test on a resource from the default Jahia module
BaseAttributesFilter attributesFilter = new BaseAttributesFilter();
attributesFilter.setRenderService(RenderService.getInstance());
RenderFilter cacheFilter = (RenderFilter) SpringContextSingleton.getInstance().getContext().getBean("cacheFilter");
ModuleCacheProvider moduleCacheProvider = (ModuleCacheProvider) SpringContextSingleton.getInstance().getContext().getBean("ModuleCacheProvider");
CacheKeyGenerator generator = moduleCacheProvider.getKeyGenerator();
final String key = (String) generator.generate(resource, context);