0

Возвращен внешний вид главной страницы

This commit is contained in:
2017-04-15 18:02:42 +03:00
parent f9c5d63993
commit 623bfb3236
11 changed files with 224 additions and 11 deletions

View File

@@ -23,6 +23,7 @@ public class SpringConfig {
@Bean
public ViewResolver viewResolver() {
FreeMarkerViewResolver viewResolver = new FreeMarkerViewResolver();
viewResolver.setContentType("text/html;charset=UTF-8");
viewResolver.setCache(true);
viewResolver.setSuffix(".ftl");
return viewResolver;

View File

@@ -14,7 +14,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
public class SpringMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/ks3logo.svg")
.addResourceLocations("classpath:/kinosearch/kinosearch3/webpp/");
final String staticPath = "classpath:/kinosearch/kinosearch3/webpp/static/";
registry.addResourceHandler("/*.svg").addResourceLocations(staticPath);
registry.addResourceHandler("/*.css").addResourceLocations(staticPath);
registry.addResourceHandler("/*.png").addResourceLocations(staticPath);
}
}

View File

@@ -18,10 +18,20 @@ public class WebAppController {
private final Logger logger = LoggerFactory.getLogger(WebAppController.class);
@RequestMapping(value = "/", method = RequestMethod.GET)
public String hello() {
public String index() {
return "index";
}
@RequestMapping(value = "/blog.html", method = RequestMethod.GET)
public String blog() {
return "blog";
}
@RequestMapping(value = "/about.html", method = RequestMethod.GET)
public String about() {
return "about";
}
@RequestMapping(value = "/favicon.ico")
public void favicon(HttpServletResponse response) {
try {