Package org.apache.struts.config

Examples of org.apache.struts.config.FormBeanConfig


                                                        HttpServletRequest request, int index) throws ClassNotFoundException,
                    IllegalAccessException, InstantiationException, InvocationTargetException {
        String formName = subMapping.getName();
        ActionForm subForm = getActionForm(subMapping, request);

        FormBeanConfig formBean = mapping.getModuleConfig().findFormBeanConfig(formName);
        String className = formBean == null ? null : formBean.getType();
        if (className == null)
            return null;

        if (subForm == null || !className.equals(subForm.getClass().getName()))
            subForm = (ActionForm) Class.forName(className).newInstance();
View Full Code Here


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

    // Look up the form bean configuration information to use
    FormBeanConfig config =
      moduleConfig.findFormBeanConfig(mapping.getName());
    if (config == null) {
      return null;
    }
View Full Code Here

    if (attribute == null) {
      return;
    }

    // Look up the form bean configuration information to use
    FormBeanConfig config =
      moduleConfig.findFormBeanConfig(mapping.getName());
    if (config == null) {
      return;
    }
View Full Code Here

        if (log.isTraceEnabled()) {
            log.trace("Performing standard action form processing");
            String attribute = mapping.getAttribute();
            if (attribute != null) {
                String name = mapping.getName();
                FormBeanConfig fbc = moduleConfig.findFormBeanConfig(name);
                if (fbc != null) {
                    if ("request".equals(mapping.getScope())) {
                        log.trace("  Bean in request scope = " +
                                  request.getAttribute(attribute));
                    } else {
View Full Code Here

        if (log.isTraceEnabled()) {
            log.trace("Performing standard action form processing");
            String attribute = mapping.getAttribute();
            if (attribute != null) {
                String name = mapping.getName();
                FormBeanConfig fbc = moduleConfig.findFormBeanConfig(name);
                if (fbc != null) {
                    if ("request".equals(mapping.getScope())) {
                        log.trace("  Bean in request scope = " +
                                  request.getAttribute(attribute));
                    } else {
View Full Code Here

            return (null);
        }

        // Look up the form bean configuration information to use
        String name = mapping.getName();
        FormBeanConfig config = moduleConfig.findFormBeanConfig(name);

        if (config == null) {
            log.warn("No FormBeanConfig found under '" + name + "'");

            return (null);
        }

        ActionForm instance =
            lookupActionForm(request, attribute, mapping.getScope());

        // Can we recycle the existing form bean instance (if there is one)?
        if ((instance != null) && config.canReuse(instance)) {
            return (instance);
        }

        return createActionForm(config, servlet);
    }
View Full Code Here

        // Process form bean extensions.
        FormBeanConfig[] formBeans = config.findFormBeanConfigs();

        for (int i = 0; i < formBeans.length; i++) {
            FormBeanConfig beanConfig = formBeans[i];

            processFormBeanExtension(beanConfig, config);
        }

        for (int i = 0; i < formBeans.length; i++) {
            FormBeanConfig formBean = formBeans[i];

            // Verify that required fields are all present for the form config
            if (formBean.getType() == null) {
                handleValueRequiredException("type", formBean.getName(),
                    "form bean");
            }

            // ... and the property configs
            FormPropertyConfig[] fpcs = formBean.findFormPropertyConfigs();

            for (int j = 0; j < fpcs.length; j++) {
                FormPropertyConfig property = fpcs[j];

                if (property.getType() == null) {
                    handleValueRequiredException("type", property.getName(),
                        "form property");
                }
            }

            // Force creation and registration of DynaActionFormClass instances
            // for all dynamic form beans
            if (formBean.getDynamic()) {
                formBean.getDynaActionFormClass();
            }
        }
    }
View Full Code Here

            // Nothing to do, then
            return beanConfig;
        }

        // Make sure that this bean is of the right class
        FormBeanConfig baseConfig = moduleConfig.findFormBeanConfig(ancestor);

        if (baseConfig == null) {
            throw new UnavailableException("Unable to find " + "form bean '"
                + ancestor + "' to extend.");
        }

        // Was our bean's class overridden already?
        if (beanConfig.getClass().equals(FormBeanConfig.class)) {
            // Ensure that our bean is using the correct class
            if (!baseConfig.getClass().equals(beanConfig.getClass())) {
                // Replace the bean with an instance of the correct class
                FormBeanConfig newBeanConfig = null;
                String baseConfigClassName = baseConfig.getClass().getName();

                try {
                    newBeanConfig =
                        (FormBeanConfig) RequestUtils.applicationInstance(baseConfigClassName);

                    // copy the values
                    BeanUtils.copyProperties(newBeanConfig, beanConfig);

                    FormPropertyConfig[] fpc =
                        beanConfig.findFormPropertyConfigs();

                    for (int i = 0; i < fpc.length; i++) {
                        newBeanConfig.addFormPropertyConfig(fpc[i]);
                    }
                } catch (Exception e) {
                    handleCreationException(baseConfigClassName, e);
                }
View Full Code Here

        if (name == null) {
            return;
        }

        FormBeanConfig config =
            mapping.getModuleConfig().findFormBeanConfig(name);

        if (config == null) {
            return;
        }
View Full Code Here

        if (name == null) {
            return;
        }

        FormBeanConfig config =
            mapping.getModuleConfig().findFormBeanConfig(name);

        if (config == null) {
            return;
        }

        // look for properties we should reset
        FormPropertyConfig[] props = config.findFormPropertyConfigs();

        for (int i = 0; i < props.length; i++) {
            String resetValue = props[i].getReset();

            // skip this property if there's no reset value
View Full Code Here

TOP

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

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.