Package org.apache.struts.action

Examples of org.apache.struts.action.ActionServlet


        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() )
        {
View Full Code Here


    {
        ModuleConfig mc = InternalUtils.getModuleConfig( modulePath, servletContext );       
       
        if ( mc == null )
        {
            ActionServlet as = InternalUtils.getActionServlet( servletContext );
               
            if ( as instanceof AutoRegisterActionServlet )
            {
                AutoRegisterActionServlet das = ( AutoRegisterActionServlet ) as;
               
View Full Code Here

            {
                //
                // If we got here, it's possible that we're dynamically registering modules, and that the
                // module hasn't been registered yet.  Try it.
                //
                ActionServlet actionServlet = InternalUtils.getActionServlet( servletContext );
                if ( actionServlet instanceof AutoRegisterActionServlet )
                {
                    try
                    {
                        AutoRegisterActionServlet servlet = ( AutoRegisterActionServlet ) actionServlet;
View Full Code Here

                ClassLevelCache.clearAll();
               
                //
                // Clear out all registered modules from the ActionServlet.
                //
                ActionServlet actionServlet = InternalUtils.getActionServlet( getServletContext() );
               
                if ( actionServlet instanceof AutoRegisterActionServlet )
                {
                    ( ( AutoRegisterActionServlet ) actionServlet ).clearRegisteredModules();
                }
View Full Code Here

     * property, or a system property, in that order.
     */
    protected void retrieveTempDir(ModuleConfig moduleConfig) {
       
        //attempt to retrieve the servlet container's temporary directory
        ActionServlet servlet = getServlet();
        if (servlet != null) {
            //attempt to retrieve the servlet container's temporary directory
            ServletContext context = servlet.getServletContext();

            try {
                tempDir =
                    (String) context.getAttribute("javax.servlet.context.tempdir");
            }
View Full Code Here

     * property, or a system property, in that order.
     */
    protected void retrieveTempDir(ApplicationConfig appConfig) {
       
        //attempt to retrieve the servlet container's temporary directory
        ActionServlet servlet = getServlet();
        if (servlet != null) {
            //attempt to retrieve the servlet container's temporary directory
            ServletContext context = servlet.getServletContext();

            try {
                tempDir =
                    (String) context.getAttribute("javax.servlet.context.tempdir");
            }
View Full Code Here

        mapping = new ActionMapping();
        request = new XHttpServletRequestSimulator();
        request.setLocale(Locale.getDefault());
        response = new XHttpServletResponseSimulator();
        servletSession = (HttpSessionSimulator)request.getSession();
        actionServlet = new ActionServlet();
        MockMessageResourcesFactory factory = new MockMessageResourcesFactory();
        resources = new MockMessageResources(factory, "");
        request.setAttribute(Globals.MESSAGES_KEY, resources);
        request.setAttribute(HibernateSessionFilter.SESSION_ATTRIBUTE_KEY, hibernateSession);
        pageContext = new MockPageContext();
View Full Code Here

            instance = (ActionForm)
                ClassUtils.getApplicationInstance(formBeanConfig.getType());
        }

        // Configure and cache the new instance
        ActionServlet servlet = (ActionServlet)
            wcontext.get(getActionServletKey());
        instance.setServlet(servlet);
        wcontext.put(getActionFormKey(), instance);
        if ("session".equals(actionConfig.getScope())) {
            wcontext.getSessionScope().put
View Full Code Here

            try {
                if (log.isDebugEnabled()) {
                    log.debug("Instantiating RequestProcessor of class " +
                              config.getControllerConfig().getProcessorClass());
                }
                ActionServlet servlet = (ActionServlet)
                context.getAttribute(Globals.ACTION_SERVLET_KEY);
                processor =
                    (RequestProcessor) RequestUtils.applicationInstance(
                        config.getControllerConfig().getProcessorClass());
                processor.init(servlet, config);
View Full Code Here

        synchronized (actions) {
            action = (Action) actions.get(type);
            if (action == null) {
                log.info("Initialize action of type: " + type + " for actionConfig " + actionConfig);
                action = (Action) ClassUtils.getApplicationInstance(type);
                ActionServlet actionServlet = (ActionServlet)
                    context.get(getActionServletKey());
                action.setServlet(actionServlet);
                actions.put(type, action);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.struts.action.ActionServlet

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.