--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureServlet.java 2010/08/30 11:53:34 1020 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureServlet.java 2010/08/30 13:59:54 1021 @@ -66,9 +66,7 @@ int station = Integer.parseInt( req.getParameter("station") ); String format = req.getParameter("format"); - DepartureBean beans; - - String stationName = StationDAO.getStationName(station); + DepartureBean beans; try { beans = fetcher.cachedLookupDepartures(station, arrival); @@ -94,14 +92,13 @@ if (format.equalsIgnoreCase("xml")) { resp.setContentType("text/xml"); - resp.getWriter().print( formatXml(beans, stationName, arrival) ); + resp.getWriter().print( formatXml(beans, arrival) ); } else if (format.equalsIgnoreCase("html")) { String advStr = req.getParameter("advanced"); boolean advanced = advStr != null ? Boolean.parseBoolean(advStr) : false; req.setAttribute("advanced", advanced); - req.setAttribute("stationname", stationName ); req.setAttribute("departurebeans", beans); req.setAttribute("stationID", station ); getServletContext().getRequestDispatcher("/ViewDepartures.jsp").forward(req,resp); @@ -111,7 +108,7 @@ } - protected String formatXml(DepartureBean beans, String stationName, boolean arrival) throws ServletException{ + protected String formatXml(DepartureBean beans, boolean arrival) throws ServletException{ String xml = ""; try { DocumentBuilder builder = docBuilderFactory.newDocumentBuilder(); @@ -120,7 +117,7 @@ Document doc = impl.createDocument(null,null,null); Element root = doc.createElement("departureinfo"); - root.setAttribute("station", stationName); + root.setAttribute("station", beans.getStationName()); root.setAttribute("arrival", Boolean.toString(arrival) ); for (String notif : beans.notifications) {