/** * This method resolves the given relative path based on this template file path. * * @param relativePath the path which should be resolved. * @return the resolved path. */ public String resolveRelativePath(String relativePath) { String resolved = this.engine.getLoader().resolveRelativePath(relativePath, this.name); if (resolved == null) { return relativePath; } else { return resolved; } }
@Bean @ConditionalOnMissingBean(name = "pebbleViewResolver") public PebbleViewResolver pebbleViewResolver() { PebbleViewResolver pvr = new PebbleViewResolver(); this.properties.applyToMvcViewResolver(pvr); pvr.setPebbleEngine(this.pebbleEngine); if (this.pebbleEngine.getLoader() instanceof ClasspathLoader) { // classpathloader doesn't like leading slashes in paths pvr.setPrefix(stripLeadingSlash(this.properties.getPrefix())); } return pvr; } }
@Bean @ConditionalOnMissingBean(name = "pebbleViewResolver") public PebbleViewResolver pebbleViewResolver() { PebbleViewResolver pvr = new PebbleViewResolver(); this.properties.applyToViewResolver(pvr); pvr.setPebbleEngine(this.pebbleEngine); if (this.pebbleEngine.getLoader() instanceof ClasspathLoader) { // classpathloader doesn't like leading slashes in paths pvr.setPrefix(stripLeadingSlash(this.properties.getPrefix())); } return pvr; } }
@Override public void afterPropertiesSet() { Loader<?> templateLoader = this.pebbleEngine.getLoader(); templateLoader.setPrefix(this.getPrefix()); templateLoader.setSuffix(this.getSuffix()); }
@Override public void afterPropertiesSet() { Loader<?> templateLoader = this.pebbleEngine.getLoader(); templateLoader.setPrefix(this.getPrefix()); templateLoader.setSuffix(this.getSuffix()); }
@Override public void afterPropertiesSet() { Loader<?> templateLoader = this.pebbleEngine.getLoader(); templateLoader.setPrefix(this.getPrefix()); templateLoader.setSuffix(this.getSuffix()); }
/** * This method resolves the given relative path based on this template file * path. * * @param relativePath the path which should be resolved. * @return the resolved path. */ public String resolveRelativePath(String relativePath) { String resolved = this.engine.getLoader().resolveRelativePath(relativePath, this.name); if (resolved == null) { return relativePath; } else { return resolved; } }
/** * This method resolves the given relative path based on this template file path. * * @param relativePath the path which should be resolved. * @return the resolved path. */ public String resolveRelativePath(String relativePath) { String resolved = this.engine.getLoader().resolveRelativePath(relativePath, this.name); if (resolved == null) { return relativePath; } else { return resolved; } }
@Override public void afterPropertiesSet() throws Exception { Loader<?> templateLoader = this.pebbleEngine.getLoader(); templateLoader.setPrefix(this.getPrefix()); templateLoader.setSuffix(this.getSuffix()); }
@Bean @ConditionalOnMissingBean(name = "pebbleViewResolver") public PebbleViewResolver pebbleViewResolver() { PebbleViewResolver pvr = new PebbleViewResolver(); pvr.setPebbleEngine(this.pebbleEngine); String prefix = this.properties.getPrefix(); if (this.pebbleEngine.getLoader() instanceof ClasspathLoader) { // classpathloader doesn't like leading slashes in paths prefix = stripLeadingSlash(prefix); } pvr.setPrefix(prefix); pvr.setSuffix(this.properties.getSuffix()); pvr.setContentType(this.properties.getContentType().toString()); pvr.setCharacterEncoding(this.properties.getEncoding().name()); pvr.setOrder(Ordered.LOWEST_PRECEDENCE - 5); pvr.setExposeRequestAttributes(this.properties.isExposeRequestAttributes()); pvr.setExposeSessionAttributes(this.properties.isExposeSessionAttributes()); return pvr; } }