Commit b2ca1f5a by Patryk Czarnik

prefix i suffix

parent 0ddcd023
......@@ -22,7 +22,7 @@ public class ProductController {
public String getProducts(Model model) {
List<Product> products = productRepository.findAll();
model.addAttribute("products", products);
return "/WEB-INF/templates/products.jsp";
return "products";
}
@GetMapping(path="/products/{id}", produces="text/html")
......@@ -30,9 +30,9 @@ public class ProductController {
Optional<Product> optProduct = productRepository.findById(id);
if(optProduct.isPresent()) {
model.addAttribute("product", optProduct.get());
return "/WEB-INF/templates/product.jsp";
return "product";
} else {
return "/WEB-INF/templates/missing_product.jsp";
return "missing_product";
}
}
......
......@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
public class RootController {
@GetMapping("/")
public String index() {
return "/WEB-INF/templates/spis_tresci.jsp";
return "spis_tresci";
}
@GetMapping("/hello")
......
spring.application.name=PC37-SklepSpring
spring.mvc.view.prefix=/WEB-INF/templates/
spring.mvc.view.suffix=.jsp
spring.datasource.url=jdbc:postgresql://localhost/sklep
spring.datasource.username=alx
spring.datasource.password=abc123
\ No newline at end of file
spring.datasource.password=abc123
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