protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int src = Integer.parseInt(request.getParameter("source"));
		if (src == Friend.REQUEST) {
			int requested_by = Integer.parseInt(request.getParameter("requested_by"));
			int requested_for = Integer.parseInt(request.getParameter("requested_for"));
			try {
				Connection con = (Connection) ((DBConnection) getServletContext().getAttribute("connection")).getConnection();
				Friend.createRequest(con, requested_by, requested_for);
				RequestDispatcher dispatch = request.getRequestDispatcher("show_user.jsp?id=" + requested_for);
				dispatch.forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		} else if (src == Friend.APPROVE) {
			int friendship_id = Integer.parseInt(request.getParameter("id"));
			Statement stmt = (Statement) getServletContext().getAttribute("statement");
			Friend.approveFriendship(stmt, friendship_id);
			RequestDispatcher dispatch = request.getRequestDispatcher("show_messages.jsp");
			dispatch.forward(request, response);
		} else if (src == Friend.UNFRIEND) {
			int requested_by = Integer.parseInt(request.getParameter("requested_by"));
			int requested_for = Integer.parseInt(request.getParameter("requested_for"));
			Statement stmt = (Statement) getServletContext().getAttribute("statement");
			try {
				Friend.unfriend(stmt, requested_by, requested_for);
				RequestDispatcher dispatch = request.getRequestDispatcher("show_user.jsp?id=" + requested_for);
				dispatch.forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
				request.setAttribute("notification", "Whoops, there was an error cancelling your friendship.  Please try again.");
				RequestDispatcher dispatch = request.getRequestDispatcher("show_user.jsp?id=" + requested_for);
				dispatch.forward(request, response);
			}
		} else if (src == Friend.DENY) {
			Statement stmt = (Statement) getServletContext().getAttribute("statement");
			int friendship_id = Integer.parseInt(request.getParameter("id"));
			try {
				Friend.deny(stmt, friendship_id);
				RequestDispatcher dispatch = request.getRequestDispatcher("show_messages.jsp");
				dispatch.forward(request, response);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
	}