Looks up the current Grails WebRequest instance
@return The GrailsWebRequest instance
771708
public static @Nullable GrailsWebRequest lookup() {
        GrailsWebRequest webRequest = null;
        RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
        if (requestAttributes instanceof GrailsWebRequest) {
            webRequest = (GrailsWebRequest) requestAttributes;
        }
        return webRequest;
    }
600743
public static GrailsApplication findApplication(ServletContext servletContext) {
        ApplicationContext wac = findApplicationContext(servletContext);
        if(wac != null) {
            return (GrailsApplication)wac.getBean(GrailsApplication.APPLICATION_ID);
        }
        return null;
    }
713922
public GetInstanceResponse getInstance(GetInstanceRequest request) {
        checkNotNull(request, "request should not be null.");
        checkNotNull(request.getInstanceId(), "request instanceId should not be null.");
        InternalRequest internalRequest = this.createRequest(
                request, HttpMethodName.GET, INSTANCE_PREFIX, request.getInstanceId());
        return this.invokeHttpClient(internalRequest, GetInstanceResponse.class);
    }
445894
public synchronized HttpRequest findRequest(String tag) {
		for (HttpRequest request : activeRequests) {
			if (StringUtils.equal(request.getTag(), tag)) {
				return request;
			}
		}
		return null;
	}
236447
public com.google.cloud.audit.RequestMetadata getRequestMetadata() {
    return requestMetadata_ == null ? com.google.cloud.audit.RequestMetadata.getDefaultInstance() : requestMetadata_;
  }
603253
protected String getCurrentTheme() {
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext();
        if (request != null) {
            val session = request.getSession(false);
            val paramName = casProperties.getTheme().getParamName();
            if (session != null) {
                return (String) session.getAttribute(paramName);
            }
            return (String) request.getAttribute(paramName);
        }
        return null;
    }
1301853
public static ThemeController get() {
		if (ThemeController.instance == null) {
			ThemeController.instance = GWT.create(ThemeController.class);
		}
		return ThemeController.instance;
	}
514480
public static function getInstance(): Request
    {
        if (self::$instance === null) {
            $calledClass    = get_called_class(); //Autorize extends this class
            self::$instance = new $calledClass;
        }

        return self::$instance;
    }
428888
public static HttpServletRequest getHttpServletRequestFromRequestAttributes() {
        try {
            return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
        } catch (final Exception e) {
            LOGGER.trace(e.getMessage(), e);
        }
        return null;
    }
359366
public static ActionResolver getCurrentActionResolver( HttpServletRequest request )
    {
        ServletContext servletContext = InternalUtils.getServletContext( request );
        return getCurrentActionResolver( request, servletContext );
    }
1331386
public com.google.protobuf.ByteString
      getRequestUrlBytes() {
    java.lang.Object ref = requestUrl_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      requestUrl_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
1074873
@Override
    final public String getRequestURI() {
        if (null == this.myURIString) {
            this.myURIString = GenericUtils.getEnglishString(this.myURIBytes);
        }
        return this.myURIString;
    }
1070941
public static final RequestType getRequestType(ExternalContext externalContext)
    {
        //Stuff is laid out strangely in this class in order to optimize
        //performance.  We want to do as few instanceof's as possible so
        //things are laid out according to the expected frequency of the
        //various requests occurring.
        if(_PORTLET_10_SUPPORTED || _PORTLET_20_SUPPORTED)
        {
            if (_PORTLET_CONTEXT_CLASS.isInstance(externalContext.getContext()))
            {
                //We are inside of a portlet container
                Object request = externalContext.getRequest();
                
                if(_PORTLET_RENDER_REQUEST_CLASS.isInstance(request))
                {
                    return RequestType.RENDER;
                }
                
                if(_PORTLET_RESOURCE_REQUEST_CLASS != null)
                {
                    if(_PORTLET_ACTION_REQUEST_CLASS.isInstance(request))
                    {
                        return RequestType.ACTION;
                    }

                    //We are in a JSR-286 container
                    if(_PORTLET_RESOURCE_REQUEST_CLASS.isInstance(request))
                    {
                        return RequestType.RESOURCE;
                    }
                    
                    return RequestType.EVENT;
                }
                
                return RequestType.ACTION;
            }
        }
        
        return RequestType.SERVLET;
    }
778962
protected function getRequest()
    {
        if (null === $this->request) {
            $this->request = $this->getParser()->getRequest();
        }

        return $this->request;
    }
298043
protected void populateParamsForMapping(GrailsWebRequest webRequest) {
        Map dispatchParams = webRequest.getParams();
        String encoding = webRequest.getRequest().getCharacterEncoding();
        if (encoding == null) encoding = "UTF-8";

        for (Map.Entry<String, Object> entry : params.entrySet()) {
            String name = entry.getKey();
            Object param = entry.getValue();
            if (param instanceof Closure) {
                param = evaluateNameForValue(param);
            }
            if (param instanceof CharSequence) {
                param = param.toString();
            }
            dispatchParams.put(name, param);
        }

        final String viewName = getViewName();
        if (viewName == null && getURI() == null) {
            webRequest.setControllerNamespace(getNamespace());
            webRequest.setControllerName(getControllerName());
            webRequest.setActionName(getActionName());
        }

        String id = getId();
        if (!GrailsStringUtils.isBlank(id)) try {
            dispatchParams.put(GrailsWebRequest.ID_PARAMETER, URLDecoder.decode(id, encoding));
        }
        catch (UnsupportedEncodingException e) {
            dispatchParams.put(GrailsWebRequest.ID_PARAMETER, id);
        }
    }
261456
public static GlobalApp getGlobalApp(ServletRequest request) {
        assert request instanceof HttpServletRequest;
        GlobalApp ga = PageFlowUtils.getGlobalApp((HttpServletRequest)request);
        if(ga == null) {
            String message = "There is no current GlobalApp!";
            LOGGER.error(message);
            throw new RuntimeException(message);
        }
        return ga;
    }
914046
public java.lang.String getRequestMethod() {
    java.lang.Object ref = requestMethod_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      requestMethod_ = s;
      return s;
    }
  }