if (userPath.equals("/category")) {
// get categoryId from request
String categoryId = request.getQueryString();
if (categoryId != null) {
Category selectedCategory = categoryFacade.find(Integer.parseInt(categoryId));
request.setAttribute("selectedCategory", selectedCategory);
Collection<Product> categoryProducts = selectedCategory.getProductCollection();
request.setAttribute("categoryProducts", categoryProducts);
}
} else if (userPath.equals("/viewCart")) {
// TODO: Implement cart page request