Gets the http servlet request from the current servlet context.

@return the http servlet request
197983
public static HttpServletRequest getHttpServletRequestFromExternalWebflowContext() {
        val servletExternalContext = (ServletExternalContext) ExternalContextHolder.getExternalContext();
        if (servletExternalContext != null) {
            return (HttpServletRequest) servletExternalContext.getNativeRequest();
        }
        return null;

    }
736127
@Override
    public String getContextPath() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getContextPath();
        return null;
    }
962710
public final ServletContext getServletContext() {
        switch (type) {
            case ServletConfig:
                return servletConfig.getServletContext();
            case FilterConfig:
                return filterConfig.getServletContext();
            case ServletContext:
                return servletContext;
            default:
                throw new IllegalStateException();
        }
    }
425036
public static WebApp get(ServletContext context) {
        Object o = context.getAttribute(WebApp.class.getName());
        if(o==null) {
            synchronized (WebApp.class) {
                o = context.getAttribute(WebApp.class.getName());
                if(o==null) {
                    o = new WebApp(context);
                    context.setAttribute(WebApp.class.getName(),o);
                }
            }
        }
        return (WebApp)o;
    }
1068271
@SuppressWarnings("unchecked")
    public HttpServletRequest getChainedRequest() throws IOException, ServletException{
        if (super.containsError())
        {
            throw super.getError();
        }
        ChainedRequest req = new ChainedRequest(this, _req);
        //transfer any auto transfer headers
        Hashtable headers = getAutoTransferringHeaders();
        Enumeration names = headers.keys();
        while (names.hasMoreElements())
        {
            String name = (String)names.nextElement();
            String value = (String)headers.get(name);
            req.setHeader(name, value);
        }

        //get headers from response and add to request
        Iterable<String> headerNames = getHeaderNames();
        for (String name:headerNames)
        {
            String value = (String)getHeader(name);
            req.setHeader(name, value);
        }


        return req;
    }
601497
public String getContextPath() {
        ServletRequest request = pageContext.getRequest();
        if (request instanceof HttpServletRequest) {
            return ((HttpServletRequest) request).getContextPath();
        }
        return "/";
    }
67680
@Nonnull
  public static String getRequestServletPath (@Nullable final HttpServletRequest aRequest)
  {
    String ret = "";
    if (aRequest != null)
      try
      {
        if (aRequest.isAsyncSupported () && aRequest.isAsyncStarted ())
          ret = (String) aRequest.getAttribute (AsyncContext.ASYNC_SERVLET_PATH);
        else
          ret = aRequest.getServletPath ();
      }
      catch (final UnsupportedOperationException ex)
      {
        // Offline request - fall through
      }
      catch (final Exception ex)
      {
        // fall through
        if (isLogExceptions ())
          if (LOGGER.isWarnEnabled ())
            LOGGER.warn ("[ServletHelper] Failed to determine servlet path of HTTP request", ex);
      }
    return ret;
  }
1344664
public static ActionServlet getActionServlet( ServletContext context )
    {
        if ( context == null ) return null;
        return ( ActionServlet ) context.getAttribute( Globals.ACTION_SERVLET_KEY );
    }
1368932
public static HttpServletRequest getRequest(JspContext jspContext) {
        PageContext pageContext = getPageContext(jspContext);
        return (HttpServletRequest)pageContext.getRequest();
    }
290446
@Nonnull
  public static String getRequestRequestURI (@Nullable final HttpServletRequest aRequest)
  {
    String ret = "";
    if (aRequest != null)
      try
      {
        if (aRequest.isAsyncSupported () && aRequest.isAsyncStarted ())
          ret = (String) aRequest.getAttribute (AsyncContext.ASYNC_REQUEST_URI);
        else
          ret = aRequest.getRequestURI ();
      }
      catch (final Exception ex)
      {
        // fall through
        if (isLogExceptions ())
          if (LOGGER.isWarnEnabled ())
            LOGGER.warn ("[ServletHelper] Failed to determine request URI of HTTP request", ex);
      }
    return ret;
  }
219722
@Nonnull
  public static StringBuffer getRequestRequestURL (@Nullable final HttpServletRequest aRequest)
  {
    StringBuffer ret = null;
    if (aRequest != null)
      try
      {
        ret = aRequest.getRequestURL ();
      }
      catch (final Exception ex)
      {
        // fall through
        if (isLogExceptions ())
          if (LOGGER.isWarnEnabled ())
            LOGGER.warn ("[ServletHelper] Failed to determine request URL of HTTP request", ex);
      }
    return ret != null ? ret : new StringBuffer ();
  }
253725
public static HttpServletResponse getHttpServletResponseFromExternalWebflowContext(final RequestContext context) {
        Assert.isInstanceOf(ServletExternalContext.class, context.getExternalContext(),
            "Cannot obtain HttpServletResponse from event of type: " + context.getExternalContext().getClass().getName());
        return (HttpServletResponse) context.getExternalContext().getNativeResponse();
    }
735201
public java.lang.String getHttpHeader() {
    java.lang.Object ref = httpHeader_;
    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();
      httpHeader_ = s;
      return s;
    }
  }
1096495
public synchronized ServletHandler getServletHandler()
    {
        if (_webAppHandler == null)
        {
            _webAppHandler= (WebApplicationHandler)getHandler(WebApplicationHandler.class);
            if (_webAppHandler == null)
            {
                if (getHandler(ServletHandler.class) != null)
                    throw new IllegalStateException("Cannot have ServletHandler in WebApplicationContext");
                _webAppHandler= new WebApplicationHandler();
                addHandler(_webAppHandler);
            }
        }
        return _webAppHandler;
    }
623439
public static HttpSession session() {
		HttpServletRequest httpServletRequest = request.get();
		return (httpServletRequest == null) ? null : httpServletRequest.getSession();
	}
457708
protected static function getRequestUrl()
    {
        $hostname = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : null);

        if(isset($hostname))
        {
            $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';

            if(!isset($_SERVER['REQUEST_URI']))
            {
                if(isset($_SERVER['QUERY_STRING']))
                {
                    return $protocol . '://' . $hostname . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
                }
                else
                {
                    return $protocol . '://' . $hostname . $_SERVER['PHP_SELF'];
                }
            }
            else
            {
                return $protocol . '://' . $hostname . $_SERVER['REQUEST_URI'];
            }
        }
        else
        {
            return null;
        }
    }
121786
public ServletContext getCurrentServletContext() {
        final ClassLoader cl = getContextClassLoader();
        if (cl == null) {
            return null;
        }
        return servletContexts.get(cl);
    }