/[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 650 by torben, Mon Apr 19 19:04:34 2010 UTC revision 711 by torben, Wed May 5 20:11:03 2010 UTC
# Line 23  import org.w3c.dom.Element; Line 23  import org.w3c.dom.Element;
23    
24  import dk.thoerup.circuitbreaker.CircuitBreakerException;  import dk.thoerup.circuitbreaker.CircuitBreakerException;
25  import dk.thoerup.traininfoservice.StationDAO;  import dk.thoerup.traininfoservice.StationDAO;
26    import dk.thoerup.traininfoservice.Statistics;
27    
28  /**  /**
29   * Servlet implementation class DepartureServlet   * Servlet implementation class DepartureServlet
# Line 48  public class DepartureServlet extends Ht Line 49  public class DepartureServlet extends Ht
49          }          }
50    
51          @Override          @Override
52          protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {          protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {          
53                  if (req.getParameter("station") == null) {                  if (req.getParameter("station") == null) {
54                          resp.sendError(400, "not enough parameters");                          resp.sendError(400, "not enough parameters");
55                          return;                          return;
56                  }                  }
57                    Statistics.getInstance().incrementDepartureLookups();
58                                    
59                  int station = Integer.parseInt( req.getParameter("station") );                  int station = Integer.parseInt( req.getParameter("station") );
60                  String format = req.getParameter("format");                  String format = req.getParameter("format");
# Line 144  public class DepartureServlet extends Ht Line 146  public class DepartureServlet extends Ht
146                          note.setTextContent( departure.getNote() );                          note.setTextContent( departure.getNote() );
147                          train.appendChild(note);                          train.appendChild(note);
148                                                    
149                            Element type = doc.createElement("type");
150                            type.setTextContent( departure.getType() );
151                            train.appendChild(type);
152                            
153                          root.appendChild(train);                          root.appendChild(train);
154                  }                  }
155                                    

Legend:
Removed from v.650  
changed lines
  Added in v.711

  ViewVC Help
Powered by ViewVC 1.1.20