@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<Equipment> list = service.getEquipmentList();
		request.setAttribute("equipments", list);
		String action = request.getParameter("action");
		if ("view".equals(action)) {
			Equipment item = findItem(list, getEquipmentId(request.getParameter("id")));
			if (item != null) {
				request.setAttribute("item", item);
				request.getRequestDispatcher("/WEB-INF/jsp/company-equipment-view.jsp").include(request, response);
				return;
			}
		} else if ("availability".equals(action)) {
			Equipment item = findItem(list, getEquipmentId(request.getParameter("id")));
			if (item != null) {
				request.setAttribute("item", item);
				try {
					Date startDate = df.get().parse(request.getParameter("startDate"));
					Date endDate = df.get().parse(request.getParameter("endDate"));
					request.setAttribute("startDate", request.getParameter("startDate"));
					request.setAttribute("endDate", request.getParameter("endDate"));
					request.setAttribute("isAvailable", service.isAvailable(item, startDate, endDate));
				} catch (ParseException e) {
					log.info("Invalid start/end date format");
				}
				request.getRequestDispatcher("/WEB-INF/jsp/company-equipment-view.jsp").include(request, response);
				return;
			}
		} else if ("order".equals(action)) {
			Equipment item = findItem(list, getEquipmentId(request.getParameter("id")));
			if (item != null) {
				try {
					Date startDate = df.get().parse(request.getParameter("startDate"));
					Date endDate = df.get().parse(request.getParameter("endDate"));
					service.order(item, startDate, endDate);
					log.info("Order compleate");
					response.sendRedirect(contextPath + "/");
					return;
				} catch (ParseException e) {
					log.info("Invalid start/end date format");
				}
			}
		}
		request.getRequestDispatcher("/WEB-INF/jsp/company-equipment-list.jsp").include(request, response);
	}