Examples of ActionConfig


Examples of org.apache.struts.config.ActionConfig

     * @throws Exception on any error
     */
    public boolean execute(ActionContext actionCtx)
        throws Exception {
        // Is there a form bean associated with this ActionConfig?
        ActionConfig actionConfig = actionCtx.getActionConfig();
        String name = actionConfig.getName();

        if (name == null) {
            actionCtx.setActionForm(null);

            return (false);
        }

        if (LOG.isTraceEnabled()) {
            LOG.trace("Look up form-bean " + name);
        }

        // Look up the corresponding FormBeanConfig (if any)
        FormBeanConfig formBeanConfig =
            actionConfig.getModuleConfig().findFormBeanConfig(name);

        if (formBeanConfig == null) {
            LOG.warn("No FormBeanConfig found in module "
                + actionConfig.getModuleConfig().getPrefix() + " under name "
                + name);
            actionCtx.setActionForm(null);

            return (false);
        }

        Map scope = actionCtx.getScope(actionConfig.getScope());

        ActionForm instance;

        instance = (ActionForm) scope.get(actionConfig.getAttribute());

        // Can we recycle the existing instance (if any)?
        if (!formBeanConfig.canReuse(instance)) {
            instance = formBeanConfig.createActionForm(actionCtx);
        }

        // TODO: Remove ServletActionContext when ActionForm no longer
        //  directly depends on ActionServlet
        if (actionCtx instanceof ServletActionContext) {
            // The servlet property of ActionForm is transient, so
            // ActionForms which are restored from a serialized state
            // need to have their servlet restored.
            ServletActionContext sac = (ServletActionContext) actionCtx;

            instance.setServlet(sac.getActionServlet());
        }

        actionCtx.setActionForm(instance);

        scope.put(actionConfig.getAttribute(), instance);

        return (false);
    }
View Full Code Here

Examples of org.apache.struts.config.ActionConfig

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

        ActionConfig actionConfig = actionCtx.getActionConfig();
        ActionForm actionForm = actionCtx.getActionForm();

        // Execute the Action for this request, caching returned ActionForward
        ForwardConfig forwardConfig =
            execute(actionCtx, action, actionConfig, actionForm);
View Full Code Here

Examples of org.apache.struts.config.ActionConfig

     * @throws Exception on any error
     */
    public boolean execute(ActionContext actionCtx)
        throws Exception {
        // Acquire configuration objects that we need
        ActionConfig actionConfig = actionCtx.getActionConfig();

        // Cache an include uri if found
        String include = actionConfig.getInclude();

        if (include != null) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Including " + include);
            }
View Full Code Here

Examples of org.apache.struts.config.ActionConfig

            return (false);
        }

        // Look up the class name for the desired Action
        ActionConfig actionConfig = actionCtx.getActionConfig();
        String type = actionConfig.getType();

        if (type == null) {
            LOG.trace("no type for " + actionConfig.getPath());

            return (false);
        }

        // Create (if necessary) and cache an Action instance
View Full Code Here

Examples of org.apache.struts.config.ActionConfig

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

        // Reset the form bean property values
        ActionConfig actionConfig = actionCtx.getActionConfig();

        reset(actionCtx, actionConfig, actionForm);

        populate(actionCtx, actionConfig, actionForm);
View Full Code Here

Examples of org.apache.struts.config.ActionConfig

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

        // Acquire configuration objects that we need
        ActionConfig actionConfig = actionCtx.getActionConfig();
        ModuleConfig moduleConfig = actionConfig.getModuleConfig();

        // Cache an ForwardConfig back to our input page
        ForwardConfig forwardConfig;
        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 {
View Full Code Here

Examples of org.apache.struts.config.ActionConfig

        throws IllegalAccessException, InstantiationException {
        String effectiveFormName;
        String effectiveScope;

        if (!(isEmpty(this.getActionPath()))) {
            ActionConfig actionConfig =
                context.getModuleConfig().findActionConfig(this.getActionPath());

            if (actionConfig == null) {
                throw new IllegalArgumentException(
                    "No ActionConfig found for path " + this.getActionPath());
            }

            effectiveFormName = actionConfig.getName();
            effectiveScope = actionConfig.getScope();
        } else {
            effectiveFormName = this.getFormName();
            effectiveScope = this.getScope();
        }
View Full Code Here

Examples of org.apache.struts.config.ActionConfig

     * @param context A valid ActionContext
     * @return a <code>Command</code> to execute, or null if none is specified
     *         or if the specified command cannot be found.
     */
    protected Command getCommand(ActionContext context) {
        ActionConfig actionConfig = context.getActionConfig();

        String commandName = actionConfig.getCommand();

        if (commandName == null) {
            return null;
        }

        String catalogName = actionConfig.getCatalog();

        return getCommand(commandName, catalogName);
    }
View Full Code Here

Examples of org.apache.struts.config.ActionConfig

     * @throws Exception if authorization fails
     */
    public boolean execute(ActionContext actionCtx)
        throws Exception {
        // Retrieve ActionConfig
        ActionConfig actionConfig = actionCtx.getActionConfig();

        // Is this action protected by role requirements?
        if (!isAuthorizationRequired(actionConfig)) {
            return (false);
        }

        boolean throwEx;

        try {
            throwEx =
                !(isAuthorized(actionCtx, actionConfig.getRoleNames(),
                    actionConfig));
        } catch (Exception ex) {
            throwEx = true;
            LOG.error("Unable to complete authorization process", ex);
        }
View Full Code Here

Examples of org.apache.struts.config.ActionConfig

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

        // Is validation disabled on this request?
        ActionConfig actionConfig = actionCtx.getActionConfig();

        if (!actionConfig.getValidate()) {
            return false;
        }

        // Was this request cancelled?
        if (isCancelled(actionCtx, actionConfig)) {
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.