/[projects]/android/TrainInfoService/WebContent/namesearch.jsp
ViewVC logotype

Contents of /android/TrainInfoService/WebContent/namesearch.jsp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1431 - (show annotations) (download)
Mon May 2 19:28:02 2011 UTC (13 years ago) by torben
File size: 1140 byte(s)
add a view for failed byName searches and add DumpResultSet to admin.jsp
1 <%@ page import="java.util.*" %>
2 <%@ page import="java.io.*" %>
3 <%@ page import="dk.thoerup.traininfoservice.RequestPlotter" %>
4 <%@ page import="dk.thoerup.traininfoservice.RequestPlotter" %>
5 <%@ page import="dk.thoerup.genericjavautils.HttpUtil" %>
6
7 <h2>failed searches byName</h2>
8
9 <table border='0'>
10 <tr><th width=150>IP</th><th width=200></th><th>name</th></tr>
11 <%
12
13 File files[] = RequestPlotter.getFiles(30);
14
15
16 for (File f : files ) {
17 if ( !f.exists() ) {
18 continue;
19 }
20
21 InputStream input = new FileInputStream(f);
22
23
24 BufferedReader in = new BufferedReader( new InputStreamReader(input) );
25 String line;
26 while ( (line=in.readLine()) != null) {
27 if (line.indexOf("LocateStation") == -1 ){
28 continue;
29 }
30
31 if (line.indexOf("name=") == -1 ) {
32 continue;
33 }
34 String parts[] = line.split(" ");
35 String ip = parts[0].replace("\"", "");
36 String date = parts[2].replace("\"", "");
37 String uri = parts[5];
38 String name = HttpUtil.decodeUri(uri).get("name");
39 int size = Integer.parseInt( parts[8] );
40 if (size <50) {
41 %>
42 <tr><td><%=ip%></td><td><%=date %></td><td><%=name %></td></tr>
43 <%
44 }
45
46
47 }
48 }
49 %>
50 </table>

  ViewVC Help
Powered by ViewVC 1.1.20