Search in sources :

Example 51 with Builder

use of com.opensymphony.xwork2.config.entities.PackageConfig.Builder in project struts by apache.

the class DefaultPropertiesProvider method register.

public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {
    try {
        PropertiesSettings defaultSettings = new PropertiesSettings("org/apache/struts2/default");
        loadSettings(props, defaultSettings);
    } catch (Exception e) {
        throw new ConfigurationException("Could not find or error in org/apache/struts2/default.properties", e);
    }
}
Also used : ConfigurationException(com.opensymphony.xwork2.config.ConfigurationException) ConfigurationException(com.opensymphony.xwork2.config.ConfigurationException)

Example 52 with Builder

use of com.opensymphony.xwork2.config.entities.PackageConfig.Builder in project onebusaway-application-modules by camsys.

the class SpringContainer method register.

@Override
public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {
    // Since we're about to override...
    builder.setAllowDuplicates(true);
    builder.factory(ObjectFactory.class, new Factory<ObjectFactory>() {

        public ObjectFactory create(Context xworkContext) throws Exception {
            SpringObjectFactory f = new SpringObjectFactory();
            xworkContext.getContainer().inject(f);
            f.setApplicationContext(_applicationContext);
            f.setAutowireStrategy(_autoWireStrategy);
            return f;
        }

        @Override
        public Class<? extends ObjectFactory> type() {
            return ObjectFactory.class;
        }
    });
}
Also used : Context(com.opensymphony.xwork2.inject.Context) ApplicationContext(org.springframework.context.ApplicationContext) SpringObjectFactory(com.opensymphony.xwork2.spring.SpringObjectFactory) SpringObjectFactory(com.opensymphony.xwork2.spring.SpringObjectFactory) ObjectFactory(com.opensymphony.xwork2.ObjectFactory) ConfigurationException(com.opensymphony.xwork2.config.ConfigurationException)

Aggregations

PackageConfig (com.opensymphony.xwork2.config.entities.PackageConfig)23 ResultConfig (com.opensymphony.xwork2.config.entities.ResultConfig)21 ServletContext (javax.servlet.ServletContext)21 ContainerBuilder (com.opensymphony.xwork2.inject.ContainerBuilder)19 LocatableProperties (com.opensymphony.xwork2.util.location.LocatableProperties)18 ConfigurationException (com.opensymphony.xwork2.config.ConfigurationException)17 HashSet (java.util.HashSet)14 StubConfigurationProvider (com.opensymphony.xwork2.test.StubConfigurationProvider)10 NoAnnotationAction (org.apache.struts2.convention.actions.NoAnnotationAction)7 ClassLevelResultPathAction (org.apache.struts2.convention.actions.resultpath.ClassLevelResultPathAction)6 Action (org.apache.struts2.convention.annotation.Action)6 ObjectFactory (com.opensymphony.xwork2.ObjectFactory)4 Configuration (com.opensymphony.xwork2.config.Configuration)4 Container (com.opensymphony.xwork2.inject.Container)4 Context (com.opensymphony.xwork2.inject.Context)4 ArrayList (java.util.ArrayList)4 ActionContext (com.opensymphony.xwork2.ActionContext)3 ConfigurationProvider (com.opensymphony.xwork2.config.ConfigurationProvider)3 ResultTypeConfig (com.opensymphony.xwork2.config.entities.ResultTypeConfig)3 StrutsDefaultConfigurationProvider (com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider)3