Search in sources :

Example 16 with FormBeanConfig

use of org.apache.struts.config.FormBeanConfig in project sonarqube by SonarSource.

the class ModuleConfigImpl method freeze.

/**
     * <p> Freeze the configuration of this module.  After this method
     * returns, any attempt to modify the configuration will return an
     * IllegalStateException. </p>
     */
public void freeze() {
    super.freeze();
    ActionConfig[] aconfigs = findActionConfigs();
    for (int i = 0; i < aconfigs.length; i++) {
        aconfigs[i].freeze();
    }
    matcher = new ActionConfigMatcher(aconfigs);
    getControllerConfig().freeze();
    ExceptionConfig[] econfigs = findExceptionConfigs();
    for (int i = 0; i < econfigs.length; i++) {
        econfigs[i].freeze();
    }
    FormBeanConfig[] fbconfigs = findFormBeanConfigs();
    for (int i = 0; i < fbconfigs.length; i++) {
        fbconfigs[i].freeze();
    }
    ForwardConfig[] fconfigs = findForwardConfigs();
    for (int i = 0; i < fconfigs.length; i++) {
        fconfigs[i].freeze();
    }
    MessageResourcesConfig[] mrconfigs = findMessageResourcesConfigs();
    for (int i = 0; i < mrconfigs.length; i++) {
        mrconfigs[i].freeze();
    }
    PlugInConfig[] piconfigs = findPlugInConfigs();
    for (int i = 0; i < piconfigs.length; i++) {
        piconfigs[i].freeze();
    }
}
Also used : ActionConfig(org.apache.struts.config.ActionConfig) ExceptionConfig(org.apache.struts.config.ExceptionConfig) FormBeanConfig(org.apache.struts.config.FormBeanConfig) PlugInConfig(org.apache.struts.config.PlugInConfig) ForwardConfig(org.apache.struts.config.ForwardConfig) ActionConfigMatcher(org.apache.struts.config.ActionConfigMatcher) MessageResourcesConfig(org.apache.struts.config.MessageResourcesConfig)

Example 17 with FormBeanConfig

use of org.apache.struts.config.FormBeanConfig in project sonarqube by SonarSource.

the class TestDynaActionFormClass method setUp.

// ----------------------------------------------------- Setup and Teardown
public void setUp() {
    // Construct a FormBeanConfig to be used
    beanConfig = new FormBeanConfig();
    beanConfig.setName("dynaForm");
    beanConfig.setType("org.apache.struts.action.DynaActionForm");
    // Add relevant property definitions
    for (int i = 0; i < dynaProperties.length; i++) {
        beanConfig.addFormPropertyConfig(dynaProperties[i]);
    }
    // Construct a corresponding DynaActionFormClass
    dynaClass = new DynaActionFormClass(beanConfig);
}
Also used : FormBeanConfig(org.apache.struts.config.FormBeanConfig)

Example 18 with FormBeanConfig

use of org.apache.struts.config.FormBeanConfig in project sonarqube by SonarSource.

the class TestActionServlet method testProcessFormBeanConfigClassSubFormCustomClass.

/**
     * Make sure processFormBeanConfigClass() returns the same class instance
     * if the base config isn't using a custom class.
     */
public void testProcessFormBeanConfigClassSubFormCustomClass() throws Exception {
    moduleConfig.addFormBeanConfig(baseFormBean);
    FormBeanConfig customSub = new FormBeanConfig();
    customSub.setName("customSub");
    customSub.setExtends("baseForm");
    moduleConfig.addFormBeanConfig(customSub);
    FormBeanConfig result = actionServlet.processFormBeanConfigClass(customSub, moduleConfig);
    assertSame("The instance returned should be the param given it.", customSub, result);
}
Also used : FormBeanConfig(org.apache.struts.config.FormBeanConfig)

Aggregations

FormBeanConfig (org.apache.struts.config.FormBeanConfig)18 UnavailableException (javax.servlet.UnavailableException)5 FormPropertyConfig (org.apache.struts.config.FormPropertyConfig)5 ServletException (javax.servlet.ServletException)4 ActionConfig (org.apache.struts.config.ActionConfig)4 ActionForm (org.apache.struts.action.ActionForm)3 Map (java.util.Map)2 ExceptionConfig (org.apache.struts.config.ExceptionConfig)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 MissingResourceException (java.util.MissingResourceException)1 StringTokenizer (java.util.StringTokenizer)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 JspException (javax.servlet.jsp.JspException)1 MockActionContext (org.apache.struts.chain.contexts.MockActionContext)1 ServletActionContext (org.apache.struts.chain.contexts.ServletActionContext)1 ActionConfigMatcher (org.apache.struts.config.ActionConfigMatcher)1 ForwardConfig (org.apache.struts.config.ForwardConfig)1 MessageResourcesConfig (org.apache.struts.config.MessageResourcesConfig)1 ModuleConfigFactory (org.apache.struts.config.ModuleConfigFactory)1