protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession();
TreeMap<String, List<Animal>> map = (TreeMap<String, List<Animal>>) session.getAttribute("map");
int id = Integer.parseInt(request.getParameter("id"));
Animal animalToDelete = null;
for (List<Animal> animals : map.values()) {
for (Animal animal : animals) {
if (animal.getId() == id) {
animalToDelete = animal;
}