Package net.sf.sahi.session

Examples of net.sf.sahi.session.Session


//      }
//      streamingResponse.addFilter(new TrafficLoggerFilter(TrafficLogger.getLoggerForThread()));
      streamingResponse.addFilter(new ChunkedFilter());
      return streamingResponse;
    } else {
      final Session session = requestFromBrowser.session();
      if (modify && !requestFromBrowser.isExcluded() && !session.isAjaxRedirect(requestFromBrowser.url())) {
        return new HttpModifiedResponse2(response, requestFromBrowser.isSSL(), requestFromBrowser.fileExtension(), responseCode);
      }
    }
    return response;
  }
View Full Code Here


    if (ix == -1) return wwwAuthenticate.toLowerCase();
    return wwwAuthenticate.substring(0, ix).trim().toLowerCase();
  }

  private void downloadFile(HttpRequest requestFromBrowser, HttpResponse response, String fileName) {
    Session session = requestFromBrowser.session();
    save(response, requestFromBrowser.session().id() + "__" + fileName);
    if (logger.isLoggable(Level.INFO)){
      logger.info("Setting download_lastFile = " + fileName + "\nSession Id: " + session.id());
    }
    session.setVariable("download_lastFile", fileName);
  }
View Full Code Here

* limitations under the License.
*/

public class Messages {
  public void setMessageForController(HttpRequest request){
    Session session = request.session();
    session.setVariable("CONTROLLER_MessageForController", request.getParameter("message"));
  }
View Full Code Here

  public void setMessageForController(HttpRequest request){
    Session session = request.session();
    session.setVariable("CONTROLLER_MessageForController", request.getParameter("message"));
  }
  public HttpResponse getMessageForController(HttpRequest request){
    Session session = request.session();
    return new SimpleHttpResponse(session.getVariable("CONTROLLER_MessageForController"));
  }
View Full Code Here

    Session session = request.session();
    return new SimpleHttpResponse(session.getVariable("CONTROLLER_MessageForController"));
  }
 
  public void setMessageForBrowser(HttpRequest request){
    Session session = request.session();
    String windowName = request.getParameter("windowName");
    String message = request.getParameter("message");
    message = SahiScript.modifyFunctionNames(message);
    session.setVariable("CONTROLLER_MessageForBrowser" + "_" + windowName, message);
  }
View Full Code Here

    String message = request.getParameter("message");
    message = SahiScript.modifyFunctionNames(message);
    session.setVariable("CONTROLLER_MessageForBrowser" + "_" + windowName, message);
  }
  public HttpResponse getMessageForBrowser(HttpRequest request){
    Session session = request.session();
    String windowName = request.getParameter("windowName");
    String key = "CONTROLLER_MessageForBrowser" + "_" + windowName;
    String message = session.getVariable(key);
    session.setVariable(key, null);
    return new SimpleHttpResponse("" + message);
  }
View Full Code Here

public class RhinoRuntime {
  private static final Logger logger = Logger.getLogger("net.sf.sahi.command.RhinoRuntime");
 
    public HttpResponse eval(final HttpRequest request){
        Session session = request.session();
        String toEval = request.getParameter("toEval");
        ScriptRunner scriptRunner = session.getScriptRunner();
        String result = "null";
        if (scriptRunner instanceof RhinoScriptRunner){
          RhinoScriptRunner rsr = (RhinoScriptRunner) session.getScriptRunner();
          toEval = SahiScript.modifyFunctionNames(toEval);
      result = rsr.eval(toEval);
        } else {
          logger.warning("Should not have come here: RhinoRuntime.eval: " + toEval);
        }
View Full Code Here

    public void start(final HttpRequest request) {
        startPlayback(request.session(), true, "1");
    }

    public void stop(final HttpRequest request) {
        Session session = request.session();
        if (session.getRecorder() != null) session.getRecorder().stop();
        if (session.getScriptRunner() != null) session.getScriptRunner().stop();
    }
View Full Code Here

//            suite.notifyComplete(session.id());
//        }
//    }

    public void setScriptFile(final HttpRequest request) {
        Session session = request.session();
        String dir = request.getParameter("dir");
        String fileName = request.getParameter("file");
        session.setIsWindowOpen("1".equals(request.getParameter("manual")));
        String filePath = Utils.concatPaths(dir, fileName);
        setScript(session, filePath);
    }
View Full Code Here

        String filePath = Utils.concatPaths(dir, fileName);
        setScript(session, filePath);
    }

    public void setScriptUrl(final HttpRequest request) {
        Session session = request.session();
        String url = request.getParameter("url");
        session.setIsWindowOpen("1".equals(request.getParameter("manual")));
        setScript(session, url);
    }
View Full Code Here

TOP

Related Classes of net.sf.sahi.session.Session

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.