We will simulate an online shop with items on sale, but first:
- Create an
HashMap<String, Boolean>
called items
and create at least 6 items on it, where the String is the name of the item and the Boolean indicates if it's on sale.
Read about the @RequestParam
annotation in order to handle Query Strings
: https://www.baeldung.com/spring-request-param and create a ShopController that handles the following URLs:
/shop
. The controller should show all the items in a HTML list (UL) format.
/shop?sale=true
. The controller should show items on sale in a HTML list (OL) format.