Commit d3568807 by Patryk Czarnik

missing_product

parent 71bd7eb7
......@@ -29,7 +29,11 @@ public class ProductController {
@GetMapping("/{id}")
public String readOne(@PathVariable("id") Integer productId, Model model) {
Product product = em.find(Product.class, productId);
if(product != null) {
model.addAttribute("product", product);
return "/product.jsp";
} else {
return "/missing_product.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