@RequestMapping(value = "/orders", метод = { RequestMethod.GET })
public String orderList (модель ModelMap, запрос HttpServletRequest) {
Код: Выделить всё
String uuid;
try {
uuid = (String) request.getSession().getAttribute("uuid");
List store = storeRepo.getStoresByVendorUuid(uuid);
List orders = ordersRepo.getOrdersByStoreUuid(store.get(0).getUuid());
//List user =userRepo.getUsersByUuid(orders.get(0).getCustomerUuid());
//User users = userRepo.getUserByUuid(orders.getCustomerUuid());
String[] statuses = { "New", "Placed", "Canceled", "Accepted", "Ready for pickup", "Out for pickup",
"Out for delivery", "Delivered" };
String[] colors = { "info", "primary", "danger", "success", "info", "primary", "primary", "success" };
//model.addAttribute("user", user);
model.addAttribute("statuses", statuses);
model.addAttribute("colors", colors);
model.addAttribute("orders", orders);
} catch (Exception e) {
e.printStackTrace();
}
return "orders";
}
Код: Выделить всё
ORDRS${order.uuid}
${order.ordered_by_user_name}
${statuses[order.deliveryStatus] }
[i] class="material-icons">[/i]
[i] class="fa fa-map-marker" aria-hidden="true">[/i]
[i] class="fa fa-map-marker" aria-hidden="true">[/i]
Источник: https://stackoverflow.com/questions/781 ... elp-of-jsp