Package org.apache.beehive.netui.pageflow.scoping

Examples of org.apache.beehive.netui.pageflow.scoping.ScopedRequest


            MultipartRequestHandler handler = MultipartRequestUtils.getCachedMultipartHandler( req );

            if ( handler != null )
            {
                ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest( req );
                Map textElements = handler.getTextElements();
                parameters = scopedRequest != null ? scopedRequest.filterParameterMap( textElements ) : textElements;
            }
        }
View Full Code Here


    public static ActionResult strutsLookup( ServletContext context, ServletRequest request,
                                             HttpServletResponse response, String actionOverride,
                                             String[] autoResolveExtensions )
        throws Exception
    {
        ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest( request );
        ScopedResponse scopedResponse = ScopedServletUtils.unwrapResponse( response );
        assert scopedRequest != null : request.getClass().getName();
        assert scopedResponse != null : response.getClass().getName();
        assert request instanceof HttpServletRequest : request.getClass().getName();
       
        if ( scopedRequest == null )
        {
            throw new IllegalArgumentException( "request must be of type " + ScopedRequest.class.getName() );
        }
        if ( scopedResponse == null )
        {
            throw new IllegalArgumentException( "response must be of type " + ScopedResponse.class.getName() );
        }
       
        ActionServlet as = InternalUtils.getActionServlet( context );
       
        if ( as == null )
        {
            _log.error( "There is no initialized ActionServlet.  The ActionServlet must be set to load-on-startup." );
            return null;
        }
       
        if ( actionOverride != null )
        {
            // The action must be fully-qualified with its module path.
            assert actionOverride.charAt( 0 ) == '/' : actionOverride;
            InternalStringBuilder uri = new InternalStringBuilder( scopedRequest.getContextPath() );
            uri.append( actionOverride );
            uri.append( PageFlowConstants.ACTION_EXTENSION );
            scopedRequest.setRequestURI( uri.toString() );
        }

        //
        // In case the request was already forwarded once, clear out the recorded forwarded-URI.  This
        // will allow us to tell whether processing the request actually forwarded somewhere.
        //
        scopedRequest.setForwardedURI( null );
       
        //
        // Now process the request.  We create a PageFlowRequestWrapper for pageflow-specific request-scoped info.
        //
        PageFlowRequestWrapper wrappedRequest = PageFlowRequestWrapper.wrapRequest( ( HttpServletRequest ) request );
        as.doGet( wrappedRequest, scopedResponse )// this just calls process() -- same as doPost()

        String returnURI;

        if ( ! scopedResponse.didRedirect() )
        {
            returnURI = scopedRequest.getForwardedURI();
           
            if ( autoResolveExtensions == null )
            {
                autoResolveExtensions = DEFAULT_AUTORESOLVE_EXTENSIONS;
            }
           
            if ( returnURI != null )
            {
                for ( int i = 0; i < autoResolveExtensions.length; ++i )
                {
                    if ( FileUtils.uriEndsWith( returnURI, autoResolveExtensions[i] ) )
                    {
                        scopedRequest.doForward();
                        return strutsLookup( context, wrappedRequest, scopedResponse, null, autoResolveExtensions );
                    }
                }
            }
        }
View Full Code Here

            
            MultipartRequestHandler handler = MultipartRequestUtils.getCachedMultipartHandler( req );
            
            if ( handler != null )
            {
                ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest( req );
                Map textElements = handler.getTextElements();
                parameters = scopedRequest != null ? scopedRequest.filterParameterMap( textElements ) : textElements;
            }
        }
View Full Code Here

            _idScope = idScope;
        }
       
        // if there's still no idScope and we're in a ScopedRequest, use the scope-key from the request.
        if (_idScope == null) {
            ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest(request);
            if (scopedRequest != null) {
                _idScope = scopedRequest.getScopeKey().toString();
                idScope = _idScope;
            }
        }
       
        return idScope;
View Full Code Here

    public static ActionResult strutsLookup( ServletContext context, ServletRequest request,
                                             HttpServletResponse response, String actionOverride,
                                             String[] autoResolveExtensions )
        throws Exception
    {
        ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest( request );
        ScopedResponse scopedResponse = ScopedServletUtils.unwrapResponse( response );
        assert scopedRequest != null : request.getClass().getName();
        assert scopedResponse != null : response.getClass().getName();
        assert request instanceof HttpServletRequest : request.getClass().getName();
       
        if ( scopedRequest == null )
        {
            throw new IllegalArgumentException( "request must be of type " + ScopedRequest.class.getName() );
        }
        if ( scopedResponse == null )
        {
            throw new IllegalArgumentException( "response must be of type " + ScopedResponse.class.getName() );
        }
       
        ActionServlet as = InternalUtils.getActionServlet( context );
       
        if ( as == null )
        {
            _log.error( "There is no initialized ActionServlet.  The ActionServlet must be set to load-on-startup." );
            return null;
        }
       
        if ( actionOverride != null )
        {
            // The action must be fully-qualified with its module path.
            assert actionOverride.charAt( 0 ) == '/' : actionOverride;
            InternalStringBuilder uri = new InternalStringBuilder( scopedRequest.getContextPath() );
            uri.append( actionOverride );
            uri.append( PageFlowConstants.ACTION_EXTENSION );
            scopedRequest.setRequestURI( uri.toString() );
        }

        //
        // In case the request was already forwarded once, clear out the recorded forwarded-URI.  This
        // will allow us to tell whether processing the request actually forwarded somewhere.
        //
        scopedRequest.setForwardedURI( null );
       
        //
        // Now process the request.  We create a PageFlowRequestWrapper for pageflow-specific request-scoped info.
        //
        PageFlowRequestWrapper wrappedRequest = PageFlowRequestWrapper.wrapRequest( ( HttpServletRequest ) request );
        as.doGet( wrappedRequest, scopedResponse )// this just calls process() -- same as doPost()

        String returnURI;

        if ( ! scopedResponse.didRedirect() )
        {
            returnURI = scopedRequest.getForwardedURI();
           
            if ( autoResolveExtensions == null )
            {
                autoResolveExtensions = DEFAULT_AUTORESOLVE_EXTENSIONS;
            }
           
            if ( returnURI != null )
            {
                for ( int i = 0; i < autoResolveExtensions.length; ++i )
                {
                    if ( FileUtils.uriEndsWith( returnURI, autoResolveExtensions[i] ) )
                    {
                        scopedRequest.doForward();
                        return strutsLookup( context, wrappedRequest, scopedResponse, null, autoResolveExtensions );
                    }
                }
            }
        }
View Full Code Here

    {
        urlParams.addParameter(InternalConstants.RETURN_ACTION_VIEW_RENDERER_PARAM, VIEW_RENDERER_CLASS_NAME, null);
        String onPopupDone = (_onPopupDone != null ? _onPopupDone : ON_POPUP_DONE_FUNC);
        urlParams.addParameter(ReturnActionViewRenderer.getCallbackParamName(), onPopupDone, null);
       
        ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest(request);
        if (scopedRequest != null) {
            urlParams.addParameter(ScopedServletUtils.SCOPE_ID_PARAM, scopedRequest.getScopeKey().toString(), null);
        }
    }
View Full Code Here

        srs.writeFeature(scriptReporter, results, CoreScriptFeature.POPUP_DONE, true, false, new Object[]{ON_POPUP_DONE_FUNC});
    }
   
    private static String getScopedFunctionName(ServletRequest req, String funcName)
    {
        ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest(req);
        return (scopedRequest != null ? funcName + '_' + scopedRequest.getScopeKey() : funcName);
    }
View Full Code Here

            //names = request.getParameterNames();
            return null;
        }
        else
        {
            ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest( PageFlowUtils.unwrapMultipart( request ) );
           
            if ( scopedRequest != null )
            {
                multipartParameters = scopedRequest.filterParameterMap( multipartParameters );
            }
            return multipartParameters;
        }
    }
View Full Code Here

    {
        urlParams.addParameter(InternalConstants.RETURN_ACTION_VIEW_RENDERER_PARAM, VIEW_RENDERER_CLASS_NAME, null);
        String onPopupDone = (_onPopupDone != null ? _onPopupDone : ON_POPUP_DONE_FUNC);
        urlParams.addParameter(ReturnActionViewRenderer.getCallbackParamName(), onPopupDone, null);
       
        ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest(request);
        if (scopedRequest != null) {
            urlParams.addParameter(ScopedServletUtils.SCOPE_ID_PARAM, scopedRequest.getScopeKey().toString(), null);
        }
    }
View Full Code Here

        srs.writeFeature(scriptReporter, results, "popupSupportWindowVariable", new Object[]{popupWindow});
    }
   
    private static String getScopedFunctionName(ServletRequest req, String funcName)
    {
        ScopedRequest scopedRequest = ScopedServletUtils.unwrapRequest(req);
        return (scopedRequest != null ? funcName + '_' + scopedRequest.getScopeKey() : funcName);
    }
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.pageflow.scoping.ScopedRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.