/* (non-Javadoc)
@see com.ibm.ws.webcontainer.webapp.IWebAppDispatcherContext#getRequestDispatcher(java.lang.String)
338285
public RequestDispatcher getRequestDispatcher(String path)
    {
        if (path == null)
            return null;

        if (path.startsWith("/"))
        {
            // 113234 - indicate that security check is not needed -- not any more 126196
            return getWebApp().getFacade().getRequestDispatcher(path); // true
        }
        else
        {
            if (path.startsWith("./"))
            {
                path = path.substring(2);
            }

            // begin 108232: part 1
            // method did not handle relative includes in subdirectories of docroot.
            String newPath;
            String servletPath = (String) _request.getAttribute("javax.servlet.include.servlet_path");
            if (servletPath == null)
            {
                String pathInfo = getPathInfo();
                newPath = getServletPath();
                if (pathInfo != null)
                {
                    newPath += pathInfo;
                }
            }
            else
            {
                String pathInfo = (String) _request.getAttribute("javax.servlet.include.path_info");
                newPath = servletPath;
                if (pathInfo != null)
                {
                    newPath += pathInfo;
                }
            }
            // PK67895 Allow for null newPath
            if (newPath!=null) {
                int pathElementIndex = newPath.indexOf(';');
                if (pathElementIndex==-1)
                    newPath = newPath.substring(0, newPath.lastIndexOf("/"));
                else
                    newPath = newPath.substring(0, newPath.lastIndexOf("/",pathElementIndex)); //There has to be a '/' before the ; even in the case of a welcome page at the the default context "http://localhost:9080/;somePathElement"
                path = newPath + '/' + path;
            } else {
                path = '/' + path;
            }

            // 113234 - indicate that security check is not needed --- not any more --Defect 126196
            return getWebApp().getFacade().getRequestDispatcher(path); // true
            // end 108232: part 1

        }
    }
1226487
@Override
    public Request<ModifyVpcEndpointConnectionNotificationRequest> getDryRunRequest() {
        Request<ModifyVpcEndpointConnectionNotificationRequest> request = new ModifyVpcEndpointConnectionNotificationRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
119426
public <T extends InvocationMarshaller<?>> T registerDispatcher (
        InvocationDispatcher<T> dispatcher)
    {
        return registerDispatcher(dispatcher, null);
    }
559071
@Override
    public Object getRequest() throws ESBJobInterruptedException {
        try {
            currentExchange = messageExchanges.take();
        } catch (BufferStoppedException e) {
            Thread.currentThread().interrupt();
            throw new ESBJobInterruptedException("Job canceled.");
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new ESBJobInterruptedException("Job canceled.");
        }
        return currentExchange.getRequest();
    }
186936
public HttpServletRequest getRequest() {
        HttpServletRequest request = threadLocalRequests.get();
        return request == null ? orginal : request;
    }
663943
public void setDispatch(Dispatcher.DispatcherRequest request, Dispatcher.DispatcherResponse response)
    {
        ThreadState state=state();
        state.dispatchRequest=request;
        state.dispatchResponse=response;
    }
282422
private RequestDispatcher createDispatcher(String pDispatcherClass,
                                               Converters pConverters,
                                               ServerHandle pServerHandle,
                                               Restrictor pRestrictor,
                                               Configuration pConfig) {
        try {
            Class clazz = ClassUtil.classForName(pDispatcherClass, getClass().getClassLoader());
            if (clazz == null) {
                throw new IllegalArgumentException("Couldn't lookup dispatcher " + pDispatcherClass);
            }
            try {
                Constructor constructor = clazz.getConstructor(Converters.class,
                                                               ServerHandle.class,
                                                               Restrictor.class,
                                                               Configuration.class);
                return (RequestDispatcher)
                    constructor.newInstance(pConverters,
                                            pServerHandle,
                                            pRestrictor,
                                            pConfig);
            } catch (NoSuchMethodException exp) {
                // Try without configuration as fourth parameter
                Constructor constructor = clazz.getConstructor(Converters.class,
                                                               ServerHandle.class,
                                                               Restrictor.class);
                return (RequestDispatcher)
                    constructor.newInstance(pConverters,
                                            pServerHandle,
                                            pRestrictor);
            }
        } catch (NoSuchMethodException e) {
            throw new IllegalArgumentException("Class " + pDispatcherClass + " has invalid constructor: " + e,e);
        } catch (IllegalAccessException e) {
            throw new IllegalArgumentException("Constructor of " + pDispatcherClass + " couldn't be accessed: " + e,e);
        } catch (InvocationTargetException e) {
            throw new IllegalArgumentException(e);
        } catch (InstantiationException e) {
            throw new IllegalArgumentException(pDispatcherClass + " couldn't be instantiated: " + e,e);
        }
    }
627371
public RequestBuilder get(final String url) {

    checkNotNull(url, "url may not be null");
    final AsyncHttpClient.BoundRequestBuilder ningRequestBuilder = asyncHttpClient.prepareGet(url);
    return createNewRequestBuilder(url, ningRequestBuilder);
  }
712392
@Override
    public Request<DeleteVpnConnectionRequest> getDryRunRequest() {
        Request<DeleteVpnConnectionRequest> request = new DeleteVpnConnectionRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
65524
public Class<?> getDispatcherClass (int invCode)
    {
        Object dispatcher = _dispatchers.get(invCode);
        return (dispatcher == null) ? null : dispatcher.getClass();
    }
677636
@Override
    public Request<DescribeVpcEndpointConnectionsRequest> getDryRunRequest() {
        Request<DescribeVpcEndpointConnectionsRequest> request = new DescribeVpcEndpointConnectionsRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
428888
public static HttpServletRequest getHttpServletRequestFromRequestAttributes() {
        try {
            return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
        } catch (final Exception e) {
            LOGGER.trace(e.getMessage(), e);
        }
        return null;
    }
1279282
@Override
    public Request<DisableVpcClassicLinkDnsSupportRequest> getDryRunRequest() {
        Request<DisableVpcClassicLinkDnsSupportRequest> request = new DisableVpcClassicLinkDnsSupportRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
1368932
public static HttpServletRequest getRequest(JspContext jspContext) {
        PageContext pageContext = getPageContext(jspContext);
        return (HttpServletRequest)pageContext.getRequest();
    }
402660
public RequestDispatcher createDispatcher(Object it, String viewName) throws IOException {
        try {
            // backward compatible behavior that expects full file name including ".jelly"
            Script script = findScript(viewName);
            if(script!=null)
                return new JellyRequestDispatcher(it,script);
            
            // this is what the look up was really supposed to be.
            script = findScript(viewName+".jelly");
            if(script!=null)
                return new JellyRequestDispatcher(it,script);
            return null;
        } catch (JellyException e) {
            IOException io = new IOException(e.getMessage());
            io.initCause(e);
            throw io;
        }
    }
573573
@Override
    public Request<DeleteVpcEndpointServiceConfigurationsRequest> getDryRunRequest() {
        Request<DeleteVpcEndpointServiceConfigurationsRequest> request = new DeleteVpcEndpointServiceConfigurationsRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
944155
public static function getDispatcher(): EventDispatcher
    {
        if (self::$dispatcher) {
            return self::$dispatcher;
        }

        return self::$dispatcher = self::createDispatcher();
    }