/** * @return prefix for cache key that contains current controller's context (currently plugin and namespace) */ protected String resolveCurrentControllerKeyPrefixes(boolean absolute) { String pluginContextPath; String namespace; String controller; GrailsWebRequest webRequest = GrailsWebRequest.lookup(); if(webRequest != null) { StringBuilder stringBuilder = new StringBuilder(); namespace = webRequest.getControllerNamespace(); controller = webRequest.getControllerName(); pluginContextPath = (webRequest.getAttributes() != null && webRequest.getCurrentRequest() != null) ? webRequest.getAttributes().getPluginContextPath(webRequest.getCurrentRequest()) : null; stringBuilder.append(GrailsStringUtils.isNotEmpty(pluginContextPath) ? pluginContextPath : "-"); stringBuilder.append(','); stringBuilder.append(GrailsStringUtils.isNotEmpty(namespace) ? namespace : "-"); if (!absolute && GrailsStringUtils.isNotEmpty(controller)) { stringBuilder.append(','); stringBuilder.append(controller); } return stringBuilder.toString(); } else { return null; } }
private Template findAndCacheTemplate(Object controller, TemplateVariableBinding pageScope, String templateName, String contextPath, String pluginName, final String uri) throws IOException { String templatePath = GrailsStringUtils.isNotEmpty(contextPath) ? GrailsResourceUtils.appendPiecesForUri(contextPath, templateName) : templateName; final GroovyPageScriptSource scriptSource; if (pluginName == null) {