@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		UserService userService = UserServiceFactory.getUserService();
		RequestDispatcher disp = null;
		if (userService.isUserLoggedIn()) {
			String status = (String) req.getParameter("statusdropdown");
			List<CompositeTask> listOfTask = TaskDAO.getTasks();
			List<CompositeTask> toReturn = new ArrayList<CompositeTask>();
			if (status.equals(Status.finished.getString())) {
				for (CompositeTask compositeTask : listOfTask) {
					if (compositeTask.getSubtasks().size() != 0) {
						if (areAllSubtasksFinished(compositeTask)) {
							toReturn.add(compositeTask);
						}
					}
				}
			} else {
				for (CompositeTask compositeTask : listOfTask) {
					if (compositeTask.getSubtasks().size() != 0) {
						if (!areAllSubtasksFinished(compositeTask)) {
							toReturn.add(compositeTask);
						}
					}
				}
			}
			disp = req.getRequestDispatcher("Tasks.jsp");
			req.setAttribute("listOfTasks", toReturn);
			disp.forward(req, resp);
		} else {
			disp = req.getRequestDispatcher("/projectcontrol");
			disp.forward(req, resp);

		}
	}