Package org.apache.struts.config

Examples of org.apache.struts.config.ActionConfig


        // Calculate and cache the form name
        FormComponent form = (FormComponent) component;
        String action = form.getAction();
        ModuleConfig moduleConfig = form.lookupModuleConfig(context);
        ActionConfig actionConfig = moduleConfig.findActionConfig(action);
        String beanName = actionConfig.getAttribute();
        if (beanName != null) {
            form.getAttributes().put("beanName", beanName);
        }

        // Look up attribute values we need
View Full Code Here


     * @return <code>false</code> so that processing continues
     */
    public boolean execute(Context context) throws Exception {

        // Acquire configuration objects that we need
        ActionConfig actionConfig = (ActionConfig)
            context.get(getActionConfigKey());
           
        // Cache an include uri if found
        String include = actionConfig.getInclude();
        if (include != null) {
            if (log.isDebugEnabled()) {
                log.debug("Including " + include);
            }
            context.put(getIncludeKey(), include);
View Full Code Here

        if (actionForm == null) {
            return (false);
        }

        // Reset the form bean property values
        ActionConfig actionConfig = (ActionConfig)
            context.get(getActionConfigKey());


        reset(context, actionConfig, actionForm);
View Full Code Here

        if ((valid != null) && valid.booleanValue()) {
            return (false);
        }

        // Acquire configuration objects that we need
        ActionConfig actionConfig = (ActionConfig)
            context.get(getActionConfigKey());
        ModuleConfig moduleConfig = actionConfig.getModuleConfig();

        // Cache an ForwardConfig back to our input page
        ForwardConfig forwardConfig = null;
        String input = actionConfig.getInput();
        if (moduleConfig.getControllerConfig().getInputForward()) {
            if (log.isTraceEnabled()) {
                log.trace("Finding ForwardConfig for '" + input + "'");
            }
            forwardConfig = actionConfig.findForwardConfig(input);
            if (forwardConfig == null) {
                forwardConfig = moduleConfig.findForwardConfig(input);
            }
        } else {
            if (log.isTraceEnabled()) {
View Full Code Here

     * action, else <code>true</code> to abort processing.
     */
    public boolean execute(Context context) throws Exception {

        // Retrieve ActionConfig
        ActionConfig actionConfig = (ActionConfig)
            context.get(getActionConfigKey());
           
        // Is this action protected by role requirements?
        String roles[] = actionConfig.getRoleNames();
        if ((roles == null) || (roles.length < 1)) {
            return (false);
        }
       
        boolean throwEx = false;
        try {
            throwEx = !(isAuthorized(context, roles, actionConfig));
        }
        catch (Exception ex) {
            throwEx = true;
            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()));
        } else {
            return (false);
        }
       
    }
View Full Code Here

            context.put(getValidKey(), Boolean.TRUE);
            return (false);
        }

        // Is validation disabled on this request?
        ActionConfig actionConfig = (ActionConfig)
            context.get(getActionConfigKey());
        if (!actionConfig.getValidate()) {
            context.put(getValidKey(), Boolean.TRUE);
            return (false);
        }

        // Call the validate() method of this form bean
View Full Code Here

        if ((valid == null) || !valid.booleanValue()) {
            return (false);
        }

        // Acquire configuration objects that we need
        ActionConfig actionConfig = (ActionConfig)
                                    context.get(getActionConfigKey());
        ModuleConfig moduleConfig = actionConfig.getModuleConfig();

        ForwardConfig forwardConfig = null;
        String forward = actionConfig.getForward();
        if (forward != null) {
            forwardConfig = forward(context, moduleConfig, forward);
            if (log.isDebugEnabled()) {
                log.debug("Forwarding to " + forwardConfig);
            }
View Full Code Here

            return (true);
        }

        // Look up the local or global exception handler configuration
        ExceptionConfig exceptionConfig = null;
        ActionConfig actionConfig = (ActionConfig)
            context.get(getActionConfigKey());
        ModuleConfig moduleConfig = (ModuleConfig)
            context.get(getModuleConfigKey());


        if (actionConfig != null) {
            log.debug("See if actionConfig " + actionConfig + " has an exceptionConfig for " + exception.getClass().getName());
            exceptionConfig =
                actionConfig.findException(exception.getClass());
        }

        // Handle the exception in the configured manner
        if (exceptionConfig == null) {
            log.warn("Unhandled exception", exception);
View Full Code Here

        // Cache the corresponding ActonConfig instance
        WebContext wcontext = (WebContext) context;
        ModuleConfig moduleConfig = (ModuleConfig)
            wcontext.get(getModuleConfigKey());
        ActionConfig actionConfig = moduleConfig.findActionConfig(path);

        if (actionConfig == null) {
            // Locate the mapping for unknown paths (if any)
            ActionConfig configs[] = moduleConfig.findActionConfigs();
            for (int i = 0; i < configs.length; i++) {
                if (configs[i].getUnknown()) {
                    actionConfig = configs[i];
                    break;
                }
View Full Code Here

            request.setAttribute(Globals.MAPPING_KEY, mapping);
            return (mapping);
        }

        // Locate the mapping for unknown paths (if any)
        ActionConfig configs[] = moduleConfig.findActionConfigs();
        for (int i = 0; i < configs.length; i++) {
            if (configs[i].getUnknown()) {
                mapping = (ActionMapping) configs[i];
                request.setAttribute(Globals.MAPPING_KEY, mapping);
                return (mapping);
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.