Changeset 998
- Timestamp:
- 11/19/12 15:54:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorServlet.java
r942 r998 126 126 Object value = null; 127 127 try { 128 InputStream requestInputStream = request.getInputStream(); 129 128 130 value = JSONValue.parseWithException 129 (new InputStreamReader(request .getInputStream(), "UTF-8"));131 (new InputStreamReader(requestInputStream, "UTF-8")); 130 132 131 133 if (!(value instanceof JSONObject)) { … … 171 173 if (events == null) { 172 174 Console.printerrln 173 ("incoming message does not contain valid events --> discarding it");175 ("incoming message does not contain valid events --> discarding it"); 174 176 } 175 177 else { … … 260 262 assertValue(((JSONObject) eventObj), "selectedValue", String.class); 261 263 262 if (time == null) { 263 Console.printerrln("event number " + (i + 1) + " has no valid timestamp"); 264 if (eventType == null) { 265 Console.printerrln("event number " + (i + 1) + " has no valid event type"); 266 } 267 else if (time == null) { 268 Console.printerrln(eventType + " event has no valid timestamp"); 264 269 } 265 270 else if (path == null) { 266 Console.printerrln("event number " + (i + 1) + " has no valid path"); 267 } 268 else if (eventType == null) { 269 Console.printerrln("event number " + (i + 1) + " has no valid event type"); 271 Console.printerrln(eventType + " event has no valid path"); 270 272 } 271 273 else if ((coordinates != null) && (coordinates.length != 2)) { 272 Console.printerrln( "event number " + (i + 1) + "has no valid coordinates");274 Console.printerrln(eventType + " event has no valid coordinates"); 273 275 } 274 276 else if (checkEventParameterCombinations … … 279 281 } 280 282 else { 281 Console.printerrln 282 ("event number " + (i + 1) + " has no valid parameter combination"); 283 Console.printerrln(eventType + " event has no valid parameter combination"); 283 284 } 284 285 } … … 361 362 } 362 363 else if ("onfocus".equals(eventType) || "onmouseout".equals(eventType) || 363 "onmousemove".equals(eventType) || "onunload".equals(eventType) || 364 "onbeforeunload".equals(eventType) || "onpagehide".equals(eventType) || 365 "onpageshow".equals(eventType)) 364 "onmousemove".equals(eventType) || "onload".equals(eventType) || 365 "onunload".equals(eventType) || "onbeforeunload".equals(eventType) || 366 "onpagehide".equals(eventType) || "onpageshow".equals(eventType) || 367 "onabort".equals(eventType) || "onsubmit".equals(eventType) || 368 "onplaying".equals(eventType) || "onpause".equals(eventType) || 369 "ontimeupdate".equals(eventType) || "onerror".equals(eventType) || 370 "onundo".equals(eventType) || "onreset".equals(eventType) || 371 "onselect".equals(eventType)) 366 372 { 367 373 if ((coordinates == null) && (key == null) && … … 489 495 /** 490 496 * <p> 497 * convenience method for dumping the content of a stream and returning a new stream 498 * containing the same data. 499 * </p> 500 * 501 * @param inputStream the stream to be dumped and copied 502 * @return the copy of the stream 503 * 504 * @throws IOException if the stream can not be read 505 */ 506 /*private InputStream dumpStreamContent(ServletInputStream inputStream) throws IOException { 507 List<Byte> bytes = new ArrayList<Byte>(); 508 int buf; 509 510 while ((buf = inputStream.read()) >= 0) { 511 bytes.add((byte) buf); 512 } 513 514 byte[] byteArray = new byte[bytes.size()]; 515 for (int i = 0; i < bytes.size(); i++) { 516 byteArray[i] = bytes.get(i); 517 } 518 519 System.out.println(new String(byteArray, "UTF-8")); 520 521 return new ByteArrayInputStream(byteArray); 522 }*/ 523 524 /** 525 * <p> 491 526 * convenience method for dumping an object to std out. If the object is a JSON object, it is 492 527 * deeply analyzed and its internal structure is dumped as well.
Note: See TracChangeset
for help on using the changeset viewer.