--- android/TrainInfoService/src/dk/thoerup/traininfoservice/LocateStations.java 2010/02/08 19:12:15 588 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/LocateStations.java 2010/07/05 09:48:06 958 @@ -7,6 +7,7 @@ import java.util.logging.Logger; import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -14,6 +15,7 @@ /** * Servlet implementation class LocateStations */ +@WebServlet(urlPatterns={"/LocateStations"}) public class LocateStations extends HttpServlet { private static final long serialVersionUID = 1L; @@ -41,15 +43,20 @@ protected List getStations(HttpServletRequest req) throws SQLException { List stations = null; if (req.getParameter("latitude") != null && req.getParameter("latitude") != null) { + + Statistics.getInstance().incrementStationLookupsLocation(); + double latitude = Double.parseDouble( req.getParameter("latitude") ); double longitude = Double.parseDouble( req.getParameter("longitude") ); stations = stationDao.getByLocation(latitude, longitude); } else if (req.getParameter("name") != null) { + Statistics.getInstance().incrementStationLookupsName(); String name = req.getParameter("name").trim(); stations = stationDao.getByName(name); } else if (req.getParameter("list") != null) { + Statistics.getInstance().incrementStationLookupsFavorites(); String list = transformToIntList( req.getParameter("list")); stations = stationDao.getByList(list); } @@ -61,7 +68,7 @@ StringBuffer buff = new StringBuffer(); - buff.append("\n"); + //buff.append("\n"); buff.append("\n");