/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureServlet.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureServlet.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1060 by torben, Thu Sep 16 13:32:10 2010 UTC revision 1074 by torben, Thu Sep 16 17:48:17 2010 UTC
# Line 16  import javax.xml.transform.TransformerFa Line 16  import javax.xml.transform.TransformerFa
16  import org.simpleframework.xml.Serializer;  import org.simpleframework.xml.Serializer;
17  import org.simpleframework.xml.core.Persister;  import org.simpleframework.xml.core.Persister;
18    
19    import dk.thoerup.android.traininfo.common.DepartureBean;
20  import dk.thoerup.circuitbreaker.CircuitBreakerException;  import dk.thoerup.circuitbreaker.CircuitBreakerException;
21  import dk.thoerup.traininfoservice.Statistics;  import dk.thoerup.traininfoservice.Statistics;
22    
# Line 65  public class DepartureServlet extends Ht Line 66  public class DepartureServlet extends Ht
66    
67                  try {                  try {
68                          beans = fetcher.cachedLookupDepartures(station, arrival);                          beans = fetcher.cachedLookupDepartures(station, arrival);
69                            beans.arrival = arrival;
70                  } catch (java.io.IOException ioe) {                  } catch (java.io.IOException ioe) {
71                          logger.warning("Read failed, station="+station + ". " + ioe.getMessage() );                          logger.warning("Read failed, station="+station + ". " + ioe.getMessage() );
72                          Statistics.getInstance().incrementDepartureErrors();                          Statistics.getInstance().incrementDepartureErrors();
# Line 87  public class DepartureServlet extends Ht Line 89  public class DepartureServlet extends Ht
89                                    
90                  if (format.equalsIgnoreCase("xml")) {                  if (format.equalsIgnoreCase("xml")) {
91                          resp.setContentType("text/xml");                          resp.setContentType("text/xml");
92                          resp.getWriter().print( formatXml(beans, arrival) );                          resp.getWriter().print( formatXml(beans) );
93                  } else if (format.equalsIgnoreCase("html")) {                  } else if (format.equalsIgnoreCase("html")) {
94                                                    
95                          String advStr = req.getParameter("advanced");                          String advStr = req.getParameter("advanced");
# Line 103  public class DepartureServlet extends Ht Line 105  public class DepartureServlet extends Ht
105    
106          }          }
107    
108          protected String formatXml(DepartureBean beans, boolean arrival) throws ServletException{          protected String formatXml(DepartureBean beans) throws ServletException{
109                                    
110                  Serializer serializer = new Persister();                  Serializer serializer = new Persister();
111    

Legend:
Removed from v.1060  
changed lines
  Added in v.1074

  ViewVC Help
Powered by ViewVC 1.1.20