@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String id = req.getParameter("id");
		if (id==""){
				id="0";
		}
		String message;
		Book book = bookDao.getBookById(Integer.parseInt(id));
		if ((!cardDao.isBookPresent(book)) && (!readingRoomDao.isBookPresent(book))) {
			message = "This book is in library or doesn't exist";
		} else {
			bookDao.setBookAvailability(book.getId(), 0);
			
			if (cardDao.isBookPresent(book))
				cardDao.deleteBookFromCard(book);
			else {
				readingRoomDao.deleteBookFromReadingRoom(book);
			}
			message = "The book "+book.getName()+ " now is available in Library ";
		}
		req.setAttribute("returnMessage", message);
		goToPage("/librarian.jsp", req, resp);

	}