June 2014
Beginner to intermediate
304 pages
7h 25m
English
Consider a situation where we want to filter the product list based on the brand and category variables. For example, you want to list all the products that fall under the category laptop and tablets and from the manufacturers google and dell. With the help of the matrix variables, we can form a URL to bind the brand and category variables' values into the URL as follows:
http://localhost:8080/webstore/products/filter/ByCriteria;brand=google,dell;category=tablet,laptop
Let's map this URL to a handler method with the help of the @MatrixVariable annotation:
ProductRepository interface and add one more method declaration, getProductsByFilter, on it:Set<Product> getProductsByFilter(Map<String, ...