sets common context variables<br>
<ul>
<li>contentPage</li>
<li>activeMenuName</li>
<li>activeMenu</li>
<li>rootContext</li>
<li></li>
</ul>

@param model
@param request
@return
357857
protected String addCommonContextVars(ModelMap model, HttpServletRequest request) 
	{
		return addCommonContextVars(model, request, null, null);
	}
1301842
private Map<String, Set<String>> getParameters(HttpServletRequest request) {
        Map<String, String[]> params = request.getParameterMap();

        Map<String, Set<String>> queryParameters = new HashMap<>(params.size());
        for (Map.Entry<String, String[]> entry : params.entrySet()) {
            queryParameters.put(entry.getKey(), new HashSet<>(Arrays.asList(entry.getValue())));
        }
        return queryParameters;
    }
459260
public CmsTemplateContext getTemplateContext(
        String providerName,
        CmsObject cms,
        HttpServletRequest request,
        CmsResource resource) {

        I_CmsTemplateContextProvider provider = getTemplateContextProvider(providerName);
        if (provider == null) {
            return null;
        }
        String cookieName = provider.getOverrideCookieName();
        String forcedValue = null;
        if (request != null) {
            String paramTemplateContext = request.getParameter(CmsGwtConstants.PARAM_TEMPLATE_CONTEXT);
            if (!CmsStringUtil.isEmptyOrWhitespaceOnly(paramTemplateContext)) {
                forcedValue = paramTemplateContext;
            } else if (cookieName != null) {
                forcedValue = CmsRequestUtil.getCookieValue(request.getCookies(), cookieName);
            }
        }
        if (forcedValue != null) {
            Map<String, CmsTemplateContext> contextMap = provider.getAllContexts();
            if (contextMap.containsKey(forcedValue)) {
                CmsTemplateContext contextBean = contextMap.get(forcedValue);
                return new CmsTemplateContext(
                    contextBean.getKey(),
                    contextBean.getTemplatePath(),
                    contextBean.getMessageContainer(),
                    contextBean.getProvider(),
                    contextBean.getClientVariants().values(),
                    true);

            }
        }
        return provider.getTemplateContext(cms, request, resource);
    }
1093597
protected void prepareForLoginPage(final RequestContext context) {
        val currentService = WebUtils.getService(context);
        val service = authenticationRequestServiceSelectionStrategies.resolveService(currentService, WebApplicationService.class);

        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
        val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(context);
        val webContext = new J2EContext(request, response, this.sessionStore);

        val urls = new LinkedHashSet<ProviderLoginPageConfiguration>();
        this.clients
            .findAllClients()
            .stream()
            .filter(client -> client instanceof IndirectClient && isDelegatedClientAuthorizedForService(client, service))
            .map(IndirectClient.class::cast)
            .forEach(client -> {
                try {
                    val provider = buildProviderConfiguration(client, webContext, currentService);
                    provider.ifPresent(p -> {
                        urls.add(p);
                        if (p.isAutoRedirect()) {
                            WebUtils.putDelegatedAuthenticationProviderPrimary(context, p);
                        }
                    });
                } catch (final Exception e) {
                    LOGGER.error("Cannot process client [{}]", client, e);
                }
            });

        if (!urls.isEmpty()) {
            context.getFlowScope().put(FLOW_ATTRIBUTE_PROVIDER_URLS, urls);
        } else if (response.getStatus() != HttpStatus.UNAUTHORIZED.value()) {
            LOGGER.warn("No delegated authentication providers could be determined based on the provided configuration. "
                + "Either no clients are configured, or the current access strategy rules prohibit CAS from using authentication providers for this request.");
        }
    }
621421
public static boolean containsMultipleRoutingContext(RESTRequest request) {
        //TODO: add a check for query string

        if (request instanceof ServletRESTRequestWithParams) {
            ServletRESTRequestWithParams req = (ServletRESTRequestWithParams) request;
            return (req.getParam(ClientProvider.COLLECTIVE_HOST_NAMES) != null || request.getHeader(ClientProvider.COLLECTIVE_HOST_NAMES) != null);
        }
        return request.getHeader(ClientProvider.COLLECTIVE_HOST_NAMES) != null;
    }
1333762
public static Map<String, String[]> getRequestParameters(final HttpServletRequest request) {
		if (request.getAttribute(REQUEST_PROCESSED_KEY) == null) {
			setupRequestParameters(request);
		}
		return (Map<String, String[]>) request.getAttribute(REQUEST_PARAMETERS_KEY);
	}
336672
protected WebContext createTemplateContext(RequestManager requestManager) {
        final HttpServletRequest request = requestManager.getRequest();
        final HttpServletResponse response = requestManager.getResponseManager().getResponse();
        final ServletContext servletContext = request.getServletContext();
        final Locale locale = requestManager.getUserLocale();
        return new WebContext(request, response, servletContext, locale);
    }
140197
public String getMenuName(HttpServletRequest request, String overrideName) {
		if (!StringUtils.isEmpty(overrideName)) {
			return overrideName;
		}
		String name = request.getRequestURI().replaceFirst(AdminTool.ROOTCONTEXT, "");
		if (!StringUtils.isEmpty(request.getContextPath())) {
			name = name.replaceFirst(request.getContextPath(), "");
		}
		if (name.startsWith("/")) {
			name = name.substring(1, name.length());
		}
		return name;
	}
84007
protected void activateConversationContext(HttpServletRequest request) {
        HttpConversationContext conversationContext = httpConversationContext();

        /*
         * Don't try to reactivate the ConversationContext if we have already activated it for this request WELD-877
         */
        if (!isContextActivatedInRequest(request)) {
            setContextActivatedInRequest(request);
            activate(conversationContext, request);
        } else {
            /*
             * We may have previously been associated with a ConversationContext, but the reference to that context may have been lost during a Servlet forward
             * WELD-877
             */
            conversationContext.dissociate(request);
            conversationContext.associate(request);
            activate(conversationContext, request);
        }
    }
128711
public static Map<String, Object> createRequestParamsMap(HttpServletRequest request) {
        Map<String, Object> paramsMap = new HashMap<>();
        for (Enumeration paramNameEnum = request.getParameterNames(); paramNameEnum.hasMoreElements(); ) {
            String paramName = (String)paramNameEnum.nextElement();
            String[] paramValues = request.getParameterValues(paramName);

            if (paramValues.length == 1) {
                paramsMap.put(paramName, paramValues[0]);
            } else {
                paramsMap.put(paramName, paramValues);
            }
        }

        return paramsMap;
    }
1174193
protected Map<String,Object> getPreScriptBindings(Object request) throws ActivityException {
        Map<String,Object> binding = new HashMap<String,Object>();
        String requestVar = this.getAttributeValue(REQUEST_VARIABLE);
        if (requestVar != null && request instanceof String) {
            binding.put("request", getVariableValue(requestVar));
        }
        else {
            binding.put("request", request);
        }
        return binding;
    }
1108309
public static Map<String, Object> createHeadersMap(HttpServletRequest request) {
        Map<String, Object> headersMap = new HashMap<>();
        for (Enumeration headerNameEnum = request.getHeaderNames(); headerNameEnum.hasMoreElements(); ) {
            String headerName = (String)headerNameEnum.nextElement();
            List<String> headerValues = new ArrayList<String>();

            CollectionUtils.addAll(headerValues, request.getHeaders(headerName));

            if (headerValues.size() == 1) {
                headersMap.put(headerName, headerValues.get(0));
            } else {
                headersMap.put(headerName, headerValues.toArray(new String[headerValues.size()]));
            }
        }

        return headersMap;
    }
295896
protected RequestContext createRequestContext(HttpServletRequest request, HttpServletResponse response) {
        return new RequestContext(request, response, servletContext);
    }
351890
private static void setErrorAttributes(CmsObject cms, Throwable throwable, HttpServletRequest request) {

        String errorUri = CmsFlexController.getThrowableResourceUri(request);
        if (errorUri == null) {
            errorUri = cms.getRequestContext().getUri();
        }

        // try to get the exception root cause
        Throwable cause = CmsFlexController.getThrowable(request);
        if (cause == null) {
            cause = throwable;
        }

        request.getSession().setAttribute(THROWABLE, cause);
        request.getSession().setAttribute(PATH, errorUri);
    }
648621
public boolean actionInternalUse(HttpServletRequest request) {

        String internal = request.getParameter(PARAM_INTERNAL);

        CmsResource resource;
        boolean internalValue = false;
        if (internal != null) {
            internalValue = true;
        }
        try {
            resource = getCms().readResource(getParamResource(), CmsResourceFilter.ALL);

            int flags = resource.getFlags();

            if (internalValue) {
                flags |= CmsResource.FLAG_INTERNAL;
            } else {
                flags &= ~CmsResource.FLAG_INTERNAL;
            }

            getCms().lockResource(getParamResource());
            getCms().chflags(getParamResource(), flags);

        } catch (CmsException e) {
            m_errorMessages.add(key(Messages.ERR_MODIFY_INTERNAL_FLAG_0));
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(), e);
            }
            return false;
        }
        return true;
    }
1009250
public static RequestContext handle(final HttpServletRequest request, final HttpServletResponse response) {
        try {
            request.setCharacterEncoding("UTF-8");
            response.setCharacterEncoding("UTF-8");
        } catch (final Exception e) {
            LOGGER.log(Level.ERROR, "Sets request context character encoding failed", e);
        }

        final RequestContext ret = new RequestContext();
        ret.setRequest(request);
        ret.setResponse(response);
        Latkes.REQUEST_CONTEXT.set(ret);

        for (final Handler handler : HANDLERS) {
            ret.addHandler(handler);
        }

        ret.handle();
        result(ret);
        Latkes.REQUEST_CONTEXT.set(null);

        return ret;
    }
939614
function HttpViewContext(context) {
    /**
     * Gets or sets the body of the current view
     * @type {String}
     */
    this.body='';
    /**
     * Gets or sets the title of the page if the view will be fully rendered
     * @type {String}
     */
    this.title='';
    /**
     * Gets or sets the view layout page if the view will be fully rendered
     * @type {String}
     */
    this.layout = null;
    /**
     * Gets or sets the view data
     * @type {String}
     */
    this.data = null;
    /**
     * Represents the current HTTP context
     * @type {HttpContext}
     */
    this.context = context;

    /**
     * @name HttpViewContext#writer
     * @type HtmlWriter
     * @description Gets an instance of HtmlWriter helper class
     */
    var writer;
    Object.defineProperty(this, 'writer', {
        get:function() {
            if (writer)
                return writer;
            writer = new HtmlWriter();
            writer.indent = false;
            return writer;
        }, configurable:false, enumerable:false
    });

    var self = this;
    Object.defineProperty(this, 'model', {
        get:function() {
            if (self.context.params)
                if (self.context.params.controller)
                    return self.context.model(self.context.params.controller);
            return null;
        }, configurable:false, enumerable:false
    });

    //class extension initiators
    if (typeof this.init === 'function') {
        //call init() method
        this.init();
    }
}