Возвращен внешний вид главной страницы
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user