1 |
package dk.thoerup.traininfoservice; |
package dk.thoerup.traininfoservice; |
2 |
|
|
3 |
import java.io.ByteArrayOutputStream; |
|
4 |
import java.io.IOException; |
import java.io.IOException; |
5 |
|
import java.io.StringWriter; |
6 |
import java.sql.SQLException; |
import java.sql.SQLException; |
7 |
import java.util.logging.Level; |
import java.util.logging.Level; |
8 |
import java.util.logging.Logger; |
import java.util.logging.Logger; |
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.StationBean; |
20 |
|
import dk.thoerup.traininfoservice.db.StationDAO; |
21 |
|
|
22 |
/** |
/** |
23 |
* Servlet implementation class LocateStations |
* Servlet implementation class LocateStations |
24 |
*/ |
*/ |
66 |
Statistics.getInstance().incrementStationLookupsFavorites(); |
Statistics.getInstance().incrementStationLookupsFavorites(); |
67 |
String list = transformToIntList( req.getParameter("list")); |
String list = transformToIntList( req.getParameter("list")); |
68 |
stations = stationDao.getByList(list); |
stations = stationDao.getByList(list); |
69 |
|
} else if (req.getParameter("dump") != null) { |
70 |
|
stations = stationDao.dumpAll(); |
71 |
} |
} |
72 |
return stations; |
return stations; |
73 |
} |
} |
77 |
|
|
78 |
Serializer serializer = new Persister(); |
Serializer serializer = new Persister(); |
79 |
|
|
80 |
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
StringWriter out = new StringWriter(); |
81 |
|
|
82 |
try { |
try { |
83 |
serializer.write(stations, out); |
serializer.write(stations, out); |