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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1802 - (hide annotations) (download)
Tue May 15 12:26:52 2012 UTC (12 years ago) by torben
File size: 1346 byte(s)
dont include dummy requests in name search statistics
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 torben 1802 if (line.indexOf("dummy") != -1) { //ignore dummy requests
40     continue;
41     }
42    
43 torben 1431 String parts[] = line.split(" ");
44     String ip = parts[0].replace("\"", "");
45     String date = parts[2].replace("\"", "");
46     String uri = parts[5];
47     String name = HttpUtil.decodeUri(uri).get("name");
48     int size = Integer.parseInt( parts[8] );
49     if (size <50) {
50     %>
51     <tr><td><%=ip%></td><td><%=date %></td><td><%=name %></td></tr>
52     <%
53     }
54    
55    
56     }
57     }
58     %>
59     </table>

  ViewVC Help
Powered by ViewVC 1.1.20