Apache » Cocoon »

  Cocoon Spring Configurator
      2.1
   homepage

Cocoon Spring Configurator 2.1

Bean Configurations

The Spring Configurator supports an automatic inclusion mechanism for bean definitions. By default all configuration files ending with *.xml are read from these locations in alphabetical order:

  • All configuration files contained in jar files located at /META-INF/cocoon/spring
  • All configuration files from /WEB-INF/classes/META-INF/cocoon/spring
  • All configuration files contained in jar files located at /META-INF/cocoon/spring/[RUNNING_MODE]
  • All configuration files from /WEB-INF/classes/META-INF/cocoon/spring/[RUNNING_MODE]
If you want to deploy basic configurations together with your components, you can just put the configuration file inside the jar and the beans are available in the application context.

Property Overriding

To customize bean configurations according to your environment, the Cocoon Spring Configurator provides built-in support for Spring's property override configuration mechanism. By default, property files are read in alphabetical order from the following locations:
  • All files ending with *.properties contained in jar files located at /META-INF/cocoon/spring
  • All files ending with *.properties from /WEB-INF/classes/META-INF/cocoon/spring
  • All files ending with *.properties contained in jar files located at /META-INF/cocoon/spring/[RUNNING_MODE]
  • All files ending with *.properties from /WEB-INF/classes/META-INF/cocoon/spring/[RUNNING_MODE]
  • All files ending with *.properties from /WEB-INF/cocoon/spring
  • All files ending with *.properties from /WEB-INF/cocoon/spring/[RUNNING_MODE]
The properties defined in these property files are only used for overriding bean configurations! These values are not available through the settings object. As we suggest to use namespace based identifiers for beans, the Cocoon Spring Configurator uses the character / for separating the bean name from the property name:
my.special.beanName/property=somevalue