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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1517 - (hide annotations) (download)
Sun Jun 12 07:28:00 2011 UTC (12 years, 11 months ago) by torben
File size: 1267 byte(s)
add count parameter to namesearch views
1 torben 1431 <%@ 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    
14 torben 1517 int count = 14;
15     if (request.getParameter("count") != null) {
16     count = Integer.parseInt( request.getParameter("count") );
17     }
18 torben 1431
19 torben 1517 File files[] = RequestPlotter.getFiles(count);
20    
21 torben 1431 for (File f : files ) {
22     if ( !f.exists() ) {
23     continue;
24     }
25    
26     InputStream input = new FileInputStream(f);
27    
28    
29     BufferedReader in = new BufferedReader( new InputStreamReader(input) );
30     String line;
31     while ( (line=in.readLine()) != null) {
32     if (line.indexOf("LocateStation") == -1 ){
33     continue;
34     }
35    
36     if (line.indexOf("name=") == -1 ) {
37     continue;
38     }
39     String parts[] = line.split(" ");
40     String ip = parts[0].replace("\"", "");
41     String date = parts[2].replace("\"", "");
42     String uri = parts[5];
43     String name = HttpUtil.decodeUri(uri).get("name");
44     int size = Integer.parseInt( parts[8] );
45     if (size <50) {
46     %>
47     <tr><td><%=ip%></td><td><%=date %></td><td><%=name %></td></tr>
48     <%
49     }
50    
51    
52     }
53     }
54     %>
55     </table>

  ViewVC Help
Powered by ViewVC 1.1.20