Examples of RequestProcessor


Examples of org.apache.struts.action.RequestProcessor

   
    PageFlowRequestProcessor getRequestProcessor()
    {
        ModuleConfig mc = getModuleConfig();
        String key = Globals.REQUEST_PROCESSOR_KEY + mc.getPrefix();
        RequestProcessor rp = ( RequestProcessor ) getServletContext().getAttribute( key );
       
        //
        // The RequestProcessor may not have been initialized -- if so, just return a new (temporary) one.
        //
        if ( rp == null )
        {
            try
            {
                ControllerConfig cc = mc.getControllerConfig();
                rp = ( RequestProcessor ) RequestUtils.applicationInstance( cc.getProcessorClass() );
                rp.init( InternalUtils.getActionServlet( getServletContext() ), mc );
            }
            catch ( Exception e )
            {
                _log.error( "Could not initialize request processor for module " + mc.getPrefix(), e );
            }
        }
       
        assert rp == null || rp instanceof PageFlowRequestProcessor : rp.getClass().getName();
        return ( PageFlowRequestProcessor ) rp;
    }
View Full Code Here

Examples of org.apache.struts.action.RequestProcessor

        {
            //
            // Try to select the appropriate Struts module and delegate to its RequestProcessor.
            //
            ModuleConfig moduleConfig = InternalUtils.selectModule( modulePath, request, servletContext );
            RequestProcessor requestProcessor = getRequestProcessor( moduleConfig );
            requestProcessor.process( request, response );
        }
        else
        {
           
            //
            // This is the same as the base process() behavior, but it checks for a missing module-configuration.
            //
            ModuleConfig moduleConfig = null;
           
            if ( InternalUtils.getModuleConfig( RequestUtils.getModuleName( request, servletContext ), servletContext ) != null )
            {
                String modulePrefix = RequestUtils.getModuleName( request, servletContext );
                moduleConfig = InternalUtils.selectModule( modulePrefix, request, servletContext );
            }
           
            String servletPath = InternalUtils.getDecodedServletPath( request );
            RequestProcessor rp = moduleConfig != null ? getRequestProcessor( moduleConfig ) : null;
           
            if ( rp != null && moduleCanHandlePath( moduleConfig, rp, servletPath ) )
            {
                rp.process( request, response );
            }
            else
            {
                //
                // Initialize the ServletContext in the request.  Often, we need access to the ServletContext when we only
View Full Code Here

Examples of org.apache.struts.action.RequestProcessor

   
    PageFlowRequestProcessor getRequestProcessor()
    {
        ModuleConfig mc = getModuleConfig();
        String key = Globals.REQUEST_PROCESSOR_KEY + mc.getPrefix();
        RequestProcessor rp = ( RequestProcessor ) getServletContext().getAttribute( key );
       
        //
        // The RequestProcessor may not have been initialized -- if so, just return a new (temporary) one.
        //
        if ( rp == null )
        {
            try
            {
                ControllerConfig cc = mc.getControllerConfig();
                rp = ( RequestProcessor ) RequestUtils.applicationInstance( cc.getProcessorClass() );
                rp.init( InternalUtils.getActionServlet( getServletContext() ), mc );
            }
            catch ( Exception e )
            {
                _log.error( "Could not initialize request processor for module " + mc.getPrefix(), e );
            }
        }
       
        assert rp == null || rp instanceof PageFlowRequestProcessor : rp.getClass().getName();
        return ( PageFlowRequestProcessor ) rp;
    }
View Full Code Here

Examples of org.apache.struts.action.RequestProcessor

        {
            //
            // Try to select the appropriate Struts module and delegate to its RequestProcessor.
            //
            ModuleConfig moduleConfig = InternalUtils.selectModule( modulePath, request, servletContext );
            RequestProcessor requestProcessor = getRequestProcessor( moduleConfig );
            requestProcessor.process( request, response );
        }
        else
        {
           
            //
            // This is the same as the base process() behavior, but it checks for a missing module-configuration.
            //
            ModuleConfig moduleConfig = null;
           
            if ( InternalUtils.getModuleConfig( RequestUtils.getModuleName( request, servletContext ), servletContext ) != null )
            {
                String modulePrefix = RequestUtils.getModuleName( request, servletContext );
                moduleConfig = InternalUtils.selectModule( modulePrefix, request, servletContext );
            }
           
            String servletPath = InternalUtils.getDecodedServletPath( request );
            RequestProcessor rp = moduleConfig != null ? getRequestProcessor( moduleConfig ) : null;
           
            if ( rp != null && moduleCanHandlePath( moduleConfig, rp, servletPath ) )
            {
                rp.process( request, response );
            }
            else
            {
                if ( processUnhandledAction( request, response, servletPath ) ) return;
               
View Full Code Here

Examples of org.apache.struts.action.RequestProcessor

                request.getAttribute(Globals.MODULE_KEY);
            if (log.isTraceEnabled()) {
                log.trace("Assigned to module with prefix '" +
                          moduleConfig.getPrefix() + "'");
            }
            RequestProcessor processor =
                getRequestProcessor(moduleConfig, servletContext);
            if (log.isTraceEnabled()) {
                log.trace("Invoking request processor instance " + processor);
            }
            processor.process(request, response);
            context.responseComplete();
        } catch (Exception e) {
            log.error("Exception processing action event " + event, e);
        } finally {
            request.removeAttribute(Constants.ACTION_EVENT_KEY);
View Full Code Here

Examples of org.apache.wink.server.internal.RequestProcessor

            super.init();
            // try to get the request processor
            // the request processor can be available if it was loaded by a
            // listener
            // or when working with Spring
            RequestProcessor requestProcessor = getRequestProcessor();
            if (requestProcessor == null) {
                // create the request processor
                requestProcessor = createRequestProcessor();
                if (requestProcessor == null) {
                    throw new IllegalStateException("Request processor could not be created.");
View Full Code Here

Examples of org.apache.wink.server.internal.RequestProcessor

    }

    protected RequestProcessor createRequestProcessor() throws ClassNotFoundException,
        InstantiationException, IllegalAccessException, IOException {
        DeploymentConfiguration deploymentConfiguration = getDeploymentConfiguration();
        RequestProcessor requestProcessor = new RequestProcessor(deploymentConfiguration);
        deploymentConfiguration.addApplication(getApplication());
        return requestProcessor;
    }
View Full Code Here

Examples of org.apache.wink.server.internal.RequestProcessor

     *            servlets in the system and each one has a request processor.
     */
    public static void registerApplication(Application application,
                                           ServletContext servletContext,
                                           String requestProcessorAttribute) {
        RequestProcessor requestProcessor =
            RequestProcessor.getRequestProcessor(servletContext, requestProcessorAttribute);
        requestProcessor.getConfiguration().addApplication(application);
    }
View Full Code Here

Examples of org.apache.wink.server.internal.RequestProcessor

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,
        ServletException {

        RequestProcessor requestProcessor = getRequestProcessor();
        if (requestProcessor == null) {
            throw new ServletException(
                                       "Request processor should be initialized prior calling to admin servlet.");
        }
        ResourceRegistry registry = requestProcessor.getConfiguration().getResourceRegistry();

        String[] parameterValues = request.getParameterValues(DOCUMENT_TYPE);
        if (parameterValues == null || parameterValues.length == 0) {
            buildAdminHome(response);
            return;
View Full Code Here

Examples of org.apache.wink.server.internal.RequestProcessor

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,
        ServletException {

        RequestProcessor requestProcessor = getRequestProcessor();
        if (requestProcessor == null) {
            throw new ServletException(Messages
                .getMessage("adminServletRequestProcessorInitBeforeAdmin"));
        }
        ResourceRegistry registry = requestProcessor.getConfiguration().getResourceRegistry();

        String[] parameterValues = request.getParameterValues(DOCUMENT_TYPE);
        if (parameterValues == null || parameterValues.length == 0) {
            buildAdminHome(response);
            return;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.