From d91c5508f2172347e18ad93f6048582deda4ae02 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 26 Feb 2018 12:06:10 +0300 Subject: www: move templates to resources --- .../com/juick/www/configuration/WwwServletConfiguration.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'juick-www/src/main/java/com/juick') diff --git a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java index 60a3b9cc..1654f2ac 100644 --- a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java +++ b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java @@ -20,6 +20,7 @@ package com.juick.www.configuration; import com.juick.server.configuration.BaseWebConfiguration; import com.mitchellbosecke.pebble.PebbleEngine; import com.mitchellbosecke.pebble.extension.FormatterExtension; +import com.mitchellbosecke.pebble.loader.ClasspathLoader; import com.mitchellbosecke.pebble.loader.Loader; import com.mitchellbosecke.pebble.loader.ServletLoader; import com.mitchellbosecke.pebble.spring4.PebbleViewResolver; @@ -71,12 +72,9 @@ public class WwwServletConfiguration extends BaseWebConfiguration { configurer.enable(); } - @Inject - private ServletContext servletContext; - @Bean - public Loader templateLoader(){ - return new ServletLoader(servletContext); + public Loader templateLoader() { + return new ClasspathLoader(); } @Bean @@ -97,7 +95,7 @@ public class WwwServletConfiguration extends BaseWebConfiguration { @Bean public ViewResolver viewResolver() { PebbleViewResolver viewResolver = new PebbleViewResolver(); - viewResolver.setPrefix("/WEB-INF/"); + viewResolver.setPrefix("templates"); viewResolver.setSuffix(".html"); viewResolver.setPebbleEngine(pebbleEngine()); viewResolver.setCharacterEncoding(CharEncoding.UTF_8); -- cgit v1.2.3