Package org.apache.struts.action

Examples of org.apache.struts.action.ActionServlet


                     fbConfig.getType() + "'");
            }
        }

        // Configure and cache the form bean instance in the correct scope
        ActionServlet servlet = (ActionServlet)
            context.getExternalContext().getApplicationMap().get
            (Globals.ACTION_SERVLET_KEY);
        instance.setServlet(servlet);
        if ("request".equals(scope)) {
            context.getExternalContext().getRequestMap().put
View Full Code Here


            log.error("Unable to complete authorization process", ex);
        }
       
        if (throwEx) {
            // Retrieve internal message resources
            ActionServlet servlet =
                (ActionServlet) context.get(actionServletKey);
            MessageResources resources = servlet.getInternal();
           
            // The current user is not authorized for this action
            throw new UnauthorizedActionException(
                resources.getMessage("notAuthorized",
                actionConfig.getPath()));
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");
            } catch(ClassCastException cce) {
View Full Code Here

        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 );
        wrappedRequest.setScopedLookup( true );
        as.doGet( wrappedRequest, scopedResponse )// this just calls process() -- same as doPost()

        String returnURI;

        if ( ! scopedResponse.didRedirect() )
        {
View Full Code Here

               
                // Clear all caches of methods, etc.
                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

//     }
   
    public void testPlain()
        throws ServletException, JspException
    {
        ActionServlet   actionServlet  = new ActionServlet();
        actionServlet.init(pageContext.getServletConfig());
        actionServlet.init();

        ApplicationConfig  appConfig   = new ApplicationConfig("");

        pageContext.setAttribute(Action.APPLICATION_KEY, appConfig,
                                 PageContext.APPLICATION_SCOPE);
View Full Code Here

    }

    public void testMethod()
        throws ServletException, JspException
    {
        ActionServlet   actionServlet  = new ActionServlet();
        actionServlet.init(pageContext.getServletConfig());
        actionServlet.init();

        ApplicationConfig  appConfig   = new ApplicationConfig("");

        pageContext.setAttribute(Action.APPLICATION_KEY, appConfig,
                                 PageContext.APPLICATION_SCOPE);
View Full Code Here

     * Tests setting "forward" attribute to a Forward with a null Path.
     */
    public void testForward()
        throws ServletException, JspException {

        ActionServlet   actionServlet  = new ActionServlet();
        actionServlet.init(pageContext.getServletConfig());
        actionServlet.init();

        ApplicationConfig  appConfig   = new ApplicationConfig("");

        pageContext.setAttribute(Action.APPLICATION_KEY, appConfig,
                                 PageContext.APPLICATION_SCOPE);
View Full Code Here

               
                // Clear all caches of methods, etc.
                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

        if ( scopedResponse == null )
        {
            throw new IllegalArgumentException( "response must be of type " + ScopedResponse.class.getName() );
        }
       
        ActionServlet as = InternalUtils.getActionServlet( context );
       
        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 );
        wrappedRequest.setScopedLookup( true );

        if (as != null)
        {
            as.doGet( wrappedRequest, scopedResponse )// this just calls process() -- same as doPost()
        }
        else
        {
            // The normal servlet initialization has not completed yet
            // so rather than call doGet() directly, aquire the request
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.