Package org.apache.struts.config

Examples of org.apache.struts.config.ActionConfig


     * @since Struts 1.1
     * @deprecated Will be removed in a release after Struts 1.1.
     */
    private void defaultMappingsConfig(ModuleConfig config) {

        ActionConfig acs[] = config.findActionConfigs();
        ActionMappings am = new ActionMappings();
        am.setServlet(this);
        am.setFast(false);
        for (int i = 0; i < acs.length; i++) {
            am.addMapping((ActionMapping) acs[i]);
View Full Code Here


                    String name = attributeNode.getNodeName();
                    if("action".equals(name)) {
                        item.setAction(attributeNode.getNodeValue());
                       
                        if(moduleConfig != null) {
                            ActionConfig config = moduleConfig.findActionConfig(item.getAction());
                            item.setRights(toRightArray(config.getRoleNames()));
                        }
                    } else if("imageKey".equals(name)) {
                        item.setImageKey(attributeNode.getNodeValue());
                    } else if("altKey".equals(name)) {
                        item.setAltKey(attributeNode.getNodeValue());
View Full Code Here

                PanelStack panelStack = Panel.getPanelStack(request);
                panelStack.pop();
            }
           
            // fix backbutton problem of browser
            ActionConfig actionConfig = mapping.getModuleConfig().findActionConfig(panel.getActivePage().getAction());
            if(!this.isTokenValid(request) && !actionConfig.getInput().equals(mapping.getInput())) {
                if(log.isDebugEnabled())
                    log.debug("found invalid tab position");
               
                for(Page tab : panel.getPages())
                {
View Full Code Here

    private boolean isTabRightsValid(Page tab)
    {
        boolean valid = false;
       
        ModuleConfig moduleConfig = (ModuleConfig)pageContext.getServletContext().getAttribute(Globals.MODULE_KEY);
        ActionConfig actionConfig = moduleConfig.findActionConfig(tab.getAction());
       
        if(actionConfig != null)
        {
            Right[] rights = new Right[actionConfig.getRoleNames().length];
   
            for (int i = 0; i < actionConfig.getRoleNames().length; i++)
            {
                try
                {
                    rights[i] = Right.parseRight(actionConfig.getRoleNames()[i].trim());
                }
                catch (IllegalArgumentException e)
                {
                    log.warn("found invalid right for '" + actionConfig.getPath() + "' : " + actionConfig.getRoleNames()[i]);
                }
            }
           
            valid = AuthenticatorUtility.getInstance().authenticate((HttpServletRequest)pageContext.getRequest(), rights);
        }
View Full Code Here

    {
        ActionConfig[] actionConfigs = moduleConfig.findActionConfigs();
       
        for ( int i = 0; i < actionConfigs.length; i++ )
        {
            ActionConfig actionConfig = actionConfigs[i];
           
            if ( actionConfig instanceof PageFlowActionMapping )
            {
                PageFlowActionMapping mapping = ( PageFlowActionMapping ) actionConfig;
                String unqualifiedActionPath = ( ( PageFlowActionMapping ) actionConfig ).getUnqualifiedActionPath();
View Full Code Here

        }

        //
        // Look for a mapping for "unknown" paths
        //
        ActionConfig configs[] = moduleConfig.findActionConfigs();
        for ( int i = 0; i < configs.length; i++ )
        {
            if ( configs[i].getUnknown() )
            {
                mapping = ( ActionMapping ) configs[i];
View Full Code Here

        public FlowController controller;
    }

    public static MappingAndController getActionMapping(HttpServletRequest request, FlowController flowController, String action)
    {
        ActionConfig mapping = null;
        FlowController fc = null;

        if (flowController != null) {
            //
            // If there's a '.' delimiter, it's a shared flow action.
            //
            int dot = action.indexOf('.');

            if (dot == -1) {
                //
                // It's an action in the current page flow, or in the (deprecated) Global.app.
                //
                if (action.charAt(0) != '/') action = '/' + action;
                mapping = flowController.getModuleConfig().findActionConfig(action);
                fc = flowController;
               
                //
                // If we don't find it in the current page flow, look in Global.app.
                //
                if (mapping == null) {
                    FlowController globalApp =
                            PageFlowUtils.getSharedFlow(InternalConstants.GLOBALAPP_CLASSNAME, request);
                    if (globalApp != null) {
                        mapping = globalApp.getModuleConfig().findActionConfig(action);
                        fc = globalApp;
                    }
                }
            }
            else if (dot < action.length() - 1) {
                //
                // It's an action in a shared flow.
                //
                String sharedFlowName = action.substring(0, dot);
                if (sharedFlowName.length() > 0 && sharedFlowName.charAt(0) == '/') {
                    sharedFlowName = sharedFlowName.substring(1);
                }

                FlowController sharedFlow = (FlowController) PageFlowUtils.getSharedFlows(request).get(sharedFlowName);

                if (sharedFlow != null) {
                    String actionPath = '/' + action.substring(dot + 1);
                    mapping = sharedFlow.getModuleConfig().findActionConfig(actionPath);
                    fc = sharedFlow;
                }
            }
        }

        assert mapping == null || mapping instanceof ActionMapping : mapping.getClass().getName();

        if (mapping != null) {
            MappingAndController mac = new MappingAndController();
            mac.mapping = (ActionMapping) mapping;
            mac.controller = fc;
View Full Code Here

                    // Try the form class and all superclasses to get an overloaded action path.
                    //
                    for ( Class i = unwrappedForm.getClass(); i != null; i = i.getSuperclass() )
                    {
                        String formQualifiedActionPath = getFormQualifiedActionPath( i, mappingPath );
                        ActionConfig cf = pfActionMapping.getModuleConfig().findActionConfig( formQualifiedActionPath );
                           
                        if ( cf != null )
                        {
                            assert cf instanceof PageFlowActionMapping : cf.getClass().getName();
                               
                            if ( _log.isDebugEnabled() )
                            {
                                _log.debug( "Found form-specific mapping " + cf.getPath() +
                                           " -- choosing this one over current mapping " + mappingPath );
                            }
                               
                            pfActionMapping = ( PageFlowActionMapping ) cf;
                            mapping = pfActionMapping;
View Full Code Here

        ActionConfig[] actionConfigs = getModuleConfig().findActionConfigs();
        ArrayList actionNames = new ArrayList();
       
        for ( int i = 0; i < actionConfigs.length; i++ )
        {
            ActionConfig ac = actionConfigs[i];
            actionNames.add( ac.getPath().substring( 1 ) ); // every action path has a '/' in front of it
        }
       
        return ( String[] ) actionNames.toArray( new String[0] );
    }
View Full Code Here

     * @since Struts 1.1
     * @deprecated Will be removed in a release after Struts 1.1.
     */
    private void defaultMappingsConfig(ModuleConfig config) {

        ActionConfig acs[] = config.findActionConfigs();
        ActionMappings am = new ActionMappings();
        am.setServlet(this);
        am.setFast(false);
        for (int i = 0; i < acs.length; i++) {
            am.addMapping((ActionMapping) acs[i]);
View Full Code Here

TOP

Related Classes of org.apache.struts.config.ActionConfig

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.