protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		RequestDispatcher rd;
		HttpSession session = request.getSession();
		String eventId = request.getParameter("eventId");
		int seatRequested = Integer.parseInt((String)request.getParameter("noOfTic"));
		EventSearchBean search = new EventSearchBean();
		search.setEventId(Integer.parseInt(eventId));
		ArrayList<EventsBean> arrlBean = EventDao.getEvents(search);
		StudentBean studentbean = (StudentBean)session.getAttribute("person");
		EventsBean eventBean = new EventsBean();
		if(arrlBean.size()>0){
			eventBean=arrlBean.get(0);
			int availableSeats = eventBean.getTotalNoOfSeats()-eventBean.getBookedSeats();
			if(seatRequested>availableSeats){
				String errorMessage = "Number of seats are more than available seats!! Seats available for this event are "+availableSeats+" Please enter valid number of seats!!";
				session.setAttribute("errorMessage", errorMessage);
				rd=request.getRequestDispatcher("booktickets.jsp");
				rd.forward(request,response);
			}else{
				StudentBookingDao dao = new StudentBookingDao();
				dao.insertStudentBooking(studentbean.getStudentId(), Integer.parseInt(eventId), seatRequested);
				int bookedSeats = eventBean.getBookedSeats()+seatRequested;
				eventBean.setBookedSeats(bookedSeats);
				EventDao.updateEvents(eventBean);
				updateEventInSession(session, eventBean.getEventId(), bookedSeats);
				rd=request.getRequestDispatcher("thankyouinsert.jsp");
				rd.forward(request,response);
			}
			
		}else{
			String errorMessage = "Event was not selected appropriately! Please select the event and try again!!";
			session.setAttribute("errorMessage", errorMessage);
			rd=request.getRequestDispatcher("booktickets.jsp");
			rd.forward(request,response);
		}
		
	}