Commit 9d34bc57 by Patryk Czarnik

przeniesienie szablonów to WEB-INF

parent d3568807
......@@ -7,7 +7,6 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import sklep.model.Product;
import java.util.List;
......@@ -23,7 +22,7 @@ public class ProductController {
public String readAll(Model model) {
List<Product> products = em.createNamedQuery("Product.findAll", Product.class).getResultList();
model.addAttribute("products", products);
return "/products.jsp";
return "/WEB-INF/templates/products.jsp";
}
@GetMapping("/{id}")
......@@ -31,9 +30,9 @@ public class ProductController {
Product product = em.find(Product.class, productId);
if(product != null) {
model.addAttribute("product", product);
return "/product.jsp";
return "/WEB-INF/templates/product.jsp";
} else {
return "/missing_product.jsp";
return "/WEB-INF/templates/missing_product.jsp";
}
}
}
......@@ -11,7 +11,7 @@ import java.time.LocalDateTime;
public class RootController {
@GetMapping("/")
public String root() {
return "index.jsp";
return "/WEB-INF/templates/index.jsp";
}
@GetMapping("/hello")
......@@ -24,7 +24,7 @@ public class RootController {
public String currentTime(Model model) {
LocalDateTime now = LocalDateTime.now();
model.addAttribute("dt", now);
return "show_time.jsp";
return "/WEB-INF/templates/show_time.jsp";
}
}
......@@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<title>Aplikacja Sklep Spring</title>
<link rel="stylesheet" type="text/css" href="styl.css">
<link rel="stylesheet" type="text/css" href="../../styl.css">
</head>
<body>
<h1>Spis treści</h1>
......
......@@ -3,7 +3,7 @@
<html>
<head>
<title>Show time</title>
<link rel="stylesheet" type="text/css" href="styl.css">
<link rel="stylesheet" type="text/css" href="../../styl.css">
</head>
<body>
<h1>Bieżący czas</h1>
......
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