Commit 384058a4 by Patryk Czarnik

Konfiguracja prefix i suffix

parent 6dd44203
......@@ -12,7 +12,7 @@ public class RootController {
@RequestMapping("/")
public String index() {
return "/WEB-INF/templates/index.jsp";
return "index";
}
@RequestMapping("/hello")
......@@ -25,7 +25,10 @@ public class RootController {
public String ktoraGodzina(Model model) {
LocalDateTime dt = LocalDateTime.now();
model.addAttribute("dt", dt);
return "/WEB-INF/templates/wyswietl_czas.jsp";
return "wyswietl_czas";
// Pliki JSP umieszczamy w projekcie w src/main/webapp a nie w templates
// Tu docelowo będzie to /WEB-INF/templates :-)
// ale nie musimy pisać pełnej ścieżki w return, bo mamy to skonfigurowane w prefix/suffix
}
}
spring.datasource.url=jdbc:postgresql://localhost:5432/sklep
spring.datasource.username=kurs
spring.datasource.password=abc123
spring.mvc.view.prefix=/WEB-INF/templates/
spring.mvc.view.suffix=.jsp
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment