aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-02-26 12:06:10 +0300
committerGravatar Vitaly Takmazov2018-02-26 12:06:10 +0300
commitd91c5508f2172347e18ad93f6048582deda4ae02 (patch)
tree91b5fb44634f072eb21630bcaf0955766a133380 /juick-www/src/main/java/com/juick/www
parentc6bc69cee51066ae2f153208bd995d43637223c9 (diff)
www: move templates to resources
Diffstat (limited to 'juick-www/src/main/java/com/juick/www')
-rw-r--r--juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java10
1 files changed, 4 insertions, 6 deletions
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);