A master detail view is nothing but the display of very important information on a master page. Once we select an item in the master view, a detailed page of the selected item will be shown in the detail view page. Let's build a master detail view for our product listing page so that when we click on any product, we see the detailed view of that product.
We have already implemented the product listing page (http://localhost:8080/webshop/products
) and product details page (http://localhost:8080/webstore/products/product?id=P1234
), so the only thing needed is to connect these two views to make a master detail view. Perform the following steps:
Open
products.jsp
; you can findproducts.jsp
undersrc/main/webapp/WEB-INF/views/
in your project and add the followingspring
taglib
reference on top of the file:<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
Add the following lines after the Available units in stock paragraph...