projects
/
maven-thymeleaf-skin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bdb1a08
)
WIP: welcome + error
author
Kai Moritz
<kai@juplo.de>
Sat, 18 Jun 2016 19:21:47 +0000
(21:21 +0200)
committer
Kai Moritz
<kai@juplo.de>
Sat, 18 Jun 2016 19:21:47 +0000
(21:21 +0200)
src/main/java/de/juplo/thymeproxy/Application.java
patch
|
blob
|
history
diff --git
a/src/main/java/de/juplo/thymeproxy/Application.java
b/src/main/java/de/juplo/thymeproxy/Application.java
index
eb2ddbb
..
2adafb2
100644
(file)
--- a/
src/main/java/de/juplo/thymeproxy/Application.java
+++ b/
src/main/java/de/juplo/thymeproxy/Application.java
@@
-4,19
+4,24
@@
import de.juplo.thymeleaf.JuploDialect;
import java.util.HashMap;
import java.util.Map;
import org.apache.http.impl.client.CloseableHttpClient;
import java.util.HashMap;
import java.util.Map;
import org.apache.http.impl.client.CloseableHttpClient;
+import org.springframework.beans.BeanUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.core.Ordered;
import org.springframework.core.env.Environment;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.core.Ordered;
import org.springframework.core.env.Environment;
+import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.mvc.UrlFilenameViewController;
import org.thymeleaf.resourceresolver.IResourceResolver;
import org.thymeleaf.resourceresolver.UrlResourceResolver;
import org.springframework.web.servlet.mvc.UrlFilenameViewController;
import org.thymeleaf.resourceresolver.IResourceResolver;
import org.thymeleaf.resourceresolver.UrlResourceResolver;
+import org.thymeleaf.spring4.view.ThymeleafView;
+import org.thymeleaf.spring4.view.ThymeleafViewResolver;
import org.thymeleaf.templateresolver.TemplateResolver;
@SpringBootApplication
import org.thymeleaf.templateresolver.TemplateResolver;
@SpringBootApplication
-public class Application
+public class Application
extends WebMvcConfigurerAdapter
{
@Bean
public RegexUrlHandlerMapping proxiedHandlerMapping(
{
@Bean
public RegexUrlHandlerMapping proxiedHandlerMapping(
@@
-100,6
+105,20
@@
public class Application
return new JuploDialect();
}
return new JuploDialect();
}
+ @Bean
+ public ThymeleafView error()
+ {
+ ThymeleafView view = BeanUtils.instantiateClass(ThymeleafView.class);
+ view.setTemplateName("/thymeleaf/error.html");
+ return view;
+ }
+
+ @Override
+ public void addViewControllers(ViewControllerRegistry registry)
+ {
+ registry.addViewController("/").setViewName("forward:index.html");
+ }
+
public static void main(String[] args)
{
public static void main(String[] args)
{