June 2014
Beginner to intermediate
304 pages
7h 25m
English
So far in our product listing page, we have only shown product information such as the product's name, description, price, and available units in stock. However, we haven't shown information such as the manufacturer's name, category, product ID, and so on. Let's create a product details page displaying this information as follows:
ProductController class and add one more request mapping method as follows:@RequestMapping("/product")
public String getProductById(@RequestParam("id") String productId, Model model) {
model.addAttribute("product", productService.getProductById(productId));
return "product";
}product.jsp under the directory src/main/webapp/WEB-INF/views/ ...