void chooseAction(HttpServletRequest request, HttpServletResponse response,
			HttpSession session, String query, ActionsController a)
			throws ServletException, IOException, SQLException {

		switch (request.getParameter("action")) {
		case "details":
			int postId = Integer.parseInt(request.getParameter("id"));
			a.postDetails(request, response, postId);
			break;
		case "login":
			a.login(request, response, session);
			a.renderAllPosts(request, response);
			break;
		case "new_post":
			a.addToDatabase(request, response);
			break;
		case "logout":
			session.removeAttribute("userLoggedIn");
			a.redirectHome(request, response);
			break;
		case "edit":
			int id = Integer.parseInt(request.getParameter("id"));
			a.editPost(request, response, id);
			break;
		case "edit_post":
			a.replacePost(request, response);
			break;
		case "new_comment":
			a.processComment(request, response);
			break;
		case "filter_posts":
			a.filterPosts(request, response);
			break;
		case "delete":
			a.deletePost(request, response);
			break;
		default:
			// System.out.println("default chooseAction");
		}

	}