protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
HttpSession sess = request.getSession();
User curuser = (User) sess.getAttribute("curuser");
String curpost = (String) request.getParameter("id");
Users users = (Users) this.getServletContext().getAttribute("users");
boolean stop=false;
for (User u : users.getUsers().keySet()) {
for (Post p : ((List<Post>) users.getUsers().get(u))) {
if (p.getId() == Integer.parseInt(curpost)) {
if (p.getDislikers().getUsers().keySet().contains(curuser)) {
p.getDislikers().getUsers().remove(curuser);
} else {
p.getDislikers().getUsers().put(curuser, ((List<Post>) users.getUsers().get(curuser)));
}
response.sendRedirect(request.getContextPath() + "/home.jsp");
return;
}