Package net.sf.sahi.response

Examples of net.sf.sahi.response.NoCacheHttpResponse


    String uri = null;
    try {
      HttpRequest requestFromBrowser = getRequestFromBrowser();
      uri = requestFromBrowser.uri();
      if (uri.indexOf("/dyn/stopserver") != -1) {
        sendResponseToBrowser(new NoCacheHttpResponse(200, "OK", "Killing Server"));
        System.exit(1);
      }
      String fileName = fileNamefromURI(uri);
      sendResponseToBrowser(new HttpFileResponse(fileName, null, false, false));
    } catch (FileIsDirectoryException dirEx) {
      try {
        if ("/".equals(uri)) uri = "/demo";
        if (uri.endsWith("/")) uri = uri.substring(0, uri.length() - 1);
        sendResponseToBrowser(new NoCacheHttpResponse(200, "OK", "<script>location.href='"+uri+"/index.htm'</script>"));
      } catch (IOException e) {
        logger.warning(dirEx.getMessage());
      }
      logger.warning(dirEx.getMessage());
    } catch (FileNotFoundRuntimeException fnfre) {
      try {
        sendResponseToBrowser(new NoCacheHttpResponse(404, "FileNotFound", "<html><h2>404 File Not Found</h2></html>"));
      } catch (IOException e) {
        logger.warning(fnfre.getMessage());
      }
      logger.warning(fnfre.getMessage());
    }
View Full Code Here


      } else {
        s = scriptRunner.getBrowserJS(); // Other drivers
      }
    }
    if (s == null) s = "";
        return new NoCacheHttpResponse(s);
    }
View Full Code Here

    private HttpResponse proxyAutoResponse(final String startUrl, final String sessionId) {
        Properties props = new Properties();
        props.setProperty("startUrl", startUrl);
        props.setProperty("sessionId", sessionId);
        return new NoCacheHttpResponse(new HttpFileResponse(Configuration.getHtdocsRoot() + "spr/auto.htm", props, false, true));
    }
View Full Code Here

        }else{
      props.setProperty("scriptPath", "");
          props.setProperty("scriptName", "");
        }

        NoCacheHttpResponse httpResponse = new NoCacheHttpResponse(
                new HttpFileResponse(Configuration.getHtdocsRoot() + "spr/state.js", props, false, true));
        addSahisidCookie(httpResponse, session);
        return httpResponse;
    }
View Full Code Here

          if (isDelete) suite.setVariable(name, null)
        } else{
          value = session.getVariable(name);
          if (isDelete) session.setVariable(name, null);
        }
        httpResponse = new NoCacheHttpResponse(value != null
                ? Utils.encode(value)
                : "null");
        return httpResponse;
    }
View Full Code Here

        String fileName = URLParser.logFileNamefromURI(request.uri());
        if ("".equals(fileName)) {
//          long start = System.currentTimeMillis();
            String logsList = LogViewer.getLogsList(Configuration.getPlayBackLogsRoot());
//            System.out.println((System.currentTimeMillis() - start));
      NoCacheHttpResponse response = new NoCacheHttpResponse(logsList);
//            System.out.println((System.currentTimeMillis() - start));
      return response;
        } else {
            return new HttpFileResponse(fileName, null, false, false);
        }
View Full Code Here

        StringBuffer sb = new StringBuffer();
        while (it.hasNext()) {
            String key = it.next();
            sb.append("<br>").append(key).append(" ").append(Hits.hits.get(key));
        }
        return new NoCacheHttpResponse(sb.toString());
    }
View Full Code Here

          toEval = SahiScript.modifyFunctionNames(toEval);
      result = rsr.eval(toEval);
        } else {
          logger.warning("Should not have come here: RhinoRuntime.eval: " + toEval);
        }
        return new NoCacheHttpResponse(result);
    }
View Full Code Here

TOP

Related Classes of net.sf.sahi.response.NoCacheHttpResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.