Package ch.entwine.weblounge.common.impl.request

Examples of ch.entwine.weblounge.common.impl.request.WebloungeRequestImpl


    // Last resort
    if (request instanceof HttpServletRequest) {
      logger.warn("Found vanilla servlet request, defaulting to production environment");
      // TOOD: Properly determine the environment
      return new WebloungeRequestImpl((HttpServletRequest) request, Environment.Production);
    }

    return null;
  }
View Full Code Here


    if (cache != null) {
      httpResponse = cache.createCacheableResponse(httpRequest, httpResponse);
    }

    // Wrap request and response
    WebloungeRequestImpl request = new WebloungeRequestImpl(httpRequest, siteServlet, environment);
    WebloungeResponseImpl response = new WebloungeResponseImpl(httpResponse);

    // Configure request and response objects
    request.init(site);
    response.setRequest(request);
    response.setResponseCache(cache);
    response.setCharacterEncoding(DEFAULT_RESPONSE_ENCODING);
    response.setHeader("X-Powered-By", POWERED_BY);
    response.setDateHeader("Date", Calendar.getInstance().getTimeInMillis());

    // Notify listeners about starting request
    fireRequestStarted(request, response, site);

    boolean requestServed = false;

    // Ask the registered request handler if they are willing to handle
    // the request.
    try {
      securityService.setSite(site);
      request.setUser(securityService.getUser());
      for (RequestHandler handler : requestHandler) {
        try {
          logger.trace("Asking {} to serve {}", handler, request);
          if (handler.service(request, response)) {
            requestServed = true;
View Full Code Here

    } else if (httpRequest instanceof WebloungeRequest) {
      request = new SiteRequestWrapper((WebloungeRequest) httpRequest, httpRequest.getPathInfo(), false);
      response = httpResponse;
      originalRequest = false;
    } else {
      WebloungeRequestImpl webloungeRequest = new WebloungeRequestImpl(httpRequest, environment);
      webloungeRequest.init(site);
      webloungeRequest.setUser(securityService.getUser());
      String requestPath = UrlUtils.concat("/site", httpRequest.getPathInfo());
      request = new SiteRequestWrapper(webloungeRequest, requestPath, false);
      response = new WebloungeResponseImpl(httpResponse);
      ((WebloungeResponseImpl) response).setRequest(webloungeRequest);
    }
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.impl.request.WebloungeRequestImpl

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.