Returns the stylesheet name if overridden in the request object.

@param request HttpRequest
@param scope Scope (Structure or Theme)
@return Stylesheet name if set as an override in the request, else null if it was not.
335377
protected String getStyleSheetName(final HttpServletRequest request, PreferencesScope scope) {
        final String stylesheetNameFromRequest;

        if (scope.equals(PreferencesScope.STRUCTURE)) {
            stylesheetNameFromRequest =
                    (String) request.getAttribute(STYLESHEET_STRUCTURE_OVERRIDE_REQUEST_ATTRIBUTE);
        } else {
            stylesheetNameFromRequest =
                    (String) request.getAttribute(STYLESHEET_THEME_OVERRIDE_REQUEST_ATTRIBUTE_NAME);
        }

        return stylesheetNameFromRequest;
    }
1281131
public void setScope(String scopeName) {
        if ("page".equals(scopeName)) {
            scope = PageContext.PAGE_SCOPE;
        }
        else if ("request".equals(scopeName)) {
            scope = PageContext.REQUEST_SCOPE;
        }
        else if ("session".equals(scopeName)) {
            scope = PageContext.SESSION_SCOPE;
        }
        else if ("application".equals(scopeName)) {
            scope = PageContext.APPLICATION_SCOPE;
        }
    }
1041913
public static String getRequestURI(final HttpServletRequest request) {
		return (String) request.getSession(true).getAttribute(STORE_URI_KEY);
	}
1316437
public static Tag clientName(ClientRequest request) {
		String host = request.url().getHost();
		if (host == null) {
			return CLIENT_NAME_NONE;
		}
		return Tag.of("clientName", host);
	}
498958
@Override
    public final CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
        final Resource stylesheetResource = this.getStylesheetResource(request);
        final Serializable stylesheetCacheKey;
        try {
            stylesheetCacheKey = this.xmlUtilities.getStylesheetCacheKey(stylesheetResource);
        } catch (TransformerConfigurationException e) {
            throw new RuntimeException(
                    "Failed to get Transformer for stylesheet: " + stylesheetResource, e);
        } catch (IOException e) {
            throw new RuntimeException("Failed to load stylesheet: " + stylesheetResource, e);
        }

        return CacheKey.build(stylesheetResource.getDescription(), stylesheetCacheKey);
    }
975857
protected String moduleNameIdEncodingBeginLayer(HttpServletRequest request) {
		StringBuffer sb = new StringBuffer();
		if (request.getParameter(AbstractHttpTransport.SCRIPTS_REQPARAM) != null) {
			// This is a request for a bootstrap layer with non-AMD script modules.
			// Define the deps variable in global scope in case it's needed by
			// the script modules.
			sb.append("var " + EXPDEPS_VARNAME + ";");  //$NON-NLS-1$//$NON-NLS-2$
		}
		return sb.toString();
	}
990430
public static String getHeaders(HttpServletRequest request) {
        String headerString = "";
        Enumeration<String> headerNames = request.getHeaderNames();

        while (headerNames.hasMoreElements()) {
            String name = headerNames.nextElement();
            if (name.equals(Constants.ODO_PROXY_HEADER)) {
                // skip.. don't want to log this
                continue;
            }

            if (headerString.length() != 0) {
                headerString += "\n";
            }

            headerString += name + ": " + request.getHeader(name);
        }

        return headerString;
    }
1003899
public static String getStyleUri(CmsJspActionElement jsp) {

        if (m_styleUri == null) {

            CmsProject project = jsp.getCmsObject().getRequestContext().getCurrentProject();
            try {
                jsp.getCmsObject().getRequestContext().setCurrentProject(
                    jsp.getCmsObject().readProject(CmsProject.ONLINE_PROJECT_ID));
                m_styleUri = jsp.link("/system/workplace/commons/style/");
            } catch (CmsException e) {
                LOG.error(e.getLocalizedMessage());
            } finally {
                jsp.getCmsObject().getRequestContext().setCurrentProject(project);
            }
        }
        return m_styleUri;
    }
1274477
public static String getDispatchedPage(ServletRequest request) {
		String dispatchedPage = (String)request.getAttribute(DISPATCHED_PAGE_REQUEST_ATTRIBUTE);
		if(logger.isLoggable(Level.FINE)) logger.log(
			Level.FINE,
			"request={0}, dispatchedPage={1}",
			new Object[] {
				request,
				dispatchedPage
			}
		);
		return dispatchedPage;
	}
1278919
public void checkContentName(final HttpServletRequest request) {
    String reqpar = request.getParameter(getContentNameRequestName());

    // Set to null if not found.
    setContentName(reqpar);
  }
4957
private String getHttpMethod(final HttpServletRequest request) {
        String ret = (String) request.getAttribute(Keys.HttpRequest.REQUEST_METHOD);
        if (StringUtils.isBlank(ret)) {
            ret = request.getMethod();
        }

        return ret;
    }
1257467
public static String getCookieValue(HttpServletRequest request, String cookieName) {
    try {
      Cookie cookie = getCookie(request, cookieName);
      if (null == cookie) {
        return null;
      } else {
        return URLDecoder.decode(cookie.getValue(), "utf-8");
      }
    } catch (Exception e) {
      return null;
    }
  }
333217
public static String getTemplateMapperConfig(ServletRequest request) {

        String result = null;
        CmsTemplateContext templateContext = (CmsTemplateContext)request.getAttribute(
            CmsTemplateContextManager.ATTR_TEMPLATE_CONTEXT);
        if (templateContext != null) {
            I_CmsTemplateContextProvider provider = templateContext.getProvider();
            if (provider instanceof I_CmsTemplateMappingContextProvider) {
                result = ((I_CmsTemplateMappingContextProvider)provider).getMappingConfigurationPath(
                    templateContext.getKey());
            }
        }
        return result;
    }
588168
public void checkNoXSLT(final HttpServletRequest request) {
    String reqpar = request.getParameter(getNoXSLTRequestName());

    if (reqpar != null) {
      if (reqpar.equals("!")) {
        // Go back to unsticky noXslt
        setNoXSLTSticky(false);
      } else {
        setNoXSLT(true);
      }
    }

    reqpar = request.getParameter(getNoXSLTStickyRequestName());
    if (reqpar != null) {
      if (reqpar.equals("!")) {
        // Go back to unsticky noXslt
        setNoXSLTSticky(false);
      } else {
        setNoXSLT(true);
        setNoXSLTSticky(true);
      }
    }
  }
977455
public boolean matches(final HTTPRequest request) {
        if (varyHeaders.containsKey("ALL")) return false;
        Headers headers = request.getAllHeaders();

        for (Map.Entry<String, String> varyEntry : varyHeaders.entrySet()) {
            if (request.getChallenge().isPresent() && varyEntry.getKey().equals(HeaderConstants.AUTHORIZATION)) {
                if (!request.getChallenge().get().getIdentifier().equals(varyEntry.getValue())) {
                    return false;
                }
            }
            else {
                List<Header> requestHeaderValue = headers.getHeaders(varyEntry.getKey());
                boolean valid = requestHeaderValue.isEmpty() ? varyEntry.getValue() == null : headers.getFirstHeader(varyEntry.getKey()).get().getValue().equals(varyEntry.getValue());
                if (!valid) {
                    return false;
                }
            }
        }
        List<Preference> preferences = new ArrayList<>();
        preferences.addAll(headers.getAccept());
        preferences.addAll(headers.getAcceptCharset());
        preferences.addAll(headers.getAcceptLanguage());

        return !(varyHeaders.isEmpty() && !preferences.isEmpty());
    }
1362295
protected String postcss(HttpServletRequest request, String css, IResource res) throws IOException {
		if (threadScopes == null) {
			return css;
		}
		Context cx = Context.enter();
		Scriptable threadScope = null;
		String result = null;
		try {
			threadScope = threadScopes.poll(SCOPE_POOL_TIMEOUT_SECONDS, TimeUnit.SECONDS);
			if (threadScope == null) {
				throw new TimeoutException("Timeout waiting for thread scope"); //$NON-NLS-1$
			}
			Scriptable scope = cx.newObject(threadScope);
			scope.setParentScope(threadScope);
			Scriptable postcssInstance = (Scriptable)threadScope.get(POSTCSS_INSTANCE, scope);
			Function postcssProcessor = (Function)postcssInstance.getPrototype().get(PROCESS, postcssInstance);
			Object processed = postcssProcessor.call(cx, scope, postcssInstance, new Object[]{css, postcssOptions});
			result = Context.toString(processed);
		} catch (JavaScriptException e) {
			// Add module info
			String message = "Error parsing " + res.getURI() + "\r\n" + e.getMessage(); //$NON-NLS-1$ //$NON-NLS-2$
			throw new IOException(message, e);
		} catch (InterruptedException e) {
			throw new RuntimeException(e);
		} catch (TimeoutException e) {
			throw new RuntimeException(e);
		}
		finally {
			if (threadScope != null) {
				// put the thread scope back in the queue now that we're done with it
				threadScopes.add(threadScope);
			}
			Context.exit();
		}
		return result;
	}
1329923
public String getRequestInfo(HttpServletRequest request) {
        return String.format("URI: %s; Scheme: %s; Host: %s; Port: %s; Origin: %s; Method: %s",
                             request.getRequestURI(),
                             request.getScheme(),
                             request.getServerName(),
                             request.getServerPort(),
                             request.getHeader("Origin"),
                             request.getMethod());
    }