@Override
public int doEndTag() throws JspException {
IAirportDAO factory = DAOFactory.getDAOFactory(1).getAirportDAO();
ArrayList<Flight> flightList = (ArrayList<Flight>) DAOFactory.getDAOFactory(1).getFlightDAO().flightList(flightCount);
Collections.sort(flightList, new FlightComparatorTimeDesc());
try {
for (Flight flight: flightList) {
flight.setDepartureAirport(factory.loadCountryName(flight.getDepartureAirport()));
flight.setDestinationAirport(factory.loadCountryName(flight.getDestinationAirport()));
pageContext.setAttribute("singleFlight", flight, PageContext.REQUEST_SCOPE);