Menu

#6 Find a way to load all property files from within a specified folder

0.1
closed
None
CORE
2013-12-26
2013-11-08
Mirco Gatz
No

Currently all property files that will be used have to be mentioned by name within the "org.e1.config.RootConfig.java" class in the method "propertyPlaceholderConfigurer".

Please try to find a way to load all existing property files without mentioning them by name.
Should indeed keep the possibility to use Springs PropertyPlaceHolder functions.

Properties should be useable like in "org.e1.config.PersistenceConfig.java" by @Value annotation.

NOTE that the java config classes (RootConfig as well) will be replaced by an XML configuration.

Discussion

  • Michael Kaps

    Michael Kaps - 2013-11-14

    For XML-Configuration the Entry:

    <context:property-placeholder location="classpath:.properties"/>

    should work according to

    http://forum.spring.io/forum/spring-projects/container/40350-context-property-placeholder-question

    A subfolder can be defined as well e.g. "classpath:propertyfolder/.properties"

    Currently I have no working VM so I wasn't able to verify that Solution.

     

    Last edit: Michael Kaps 2013-11-14
  • Michael Kaps

    Michael Kaps - 2013-11-14
    • status: open --> pending
     
  • Michael Kaps

    Michael Kaps - 2013-11-26

    It's now possible to load arbitrary .properites files from the webplication modules resource folder.
    Loading properties from other modules is currently not possible.
    This will be fixed asap.

     
  • Michael Kaps

    Michael Kaps - 2013-12-01

    Property files can now be loaded from different modules.
    They are currently stored in a subdirectory named "properties".
    NOTE:
    There has to be at least one subdirectory. Loading property-files directly from the classpath's root will cause unstable loading!

     
  • Michael Kaps

    Michael Kaps - 2013-12-01
    • status: pending --> fixed
    • Category: --> CORE
     
  • Michael Kaps

    Michael Kaps - 2013-12-01
    • status: fixed --> test
    • assigned_to: Michael Kaps --> Mirco Gatz
     
  • Michael Kaps

    Michael Kaps - 2013-12-01

    Please check.

     
  • Michael Kaps

    Michael Kaps - 2013-12-15

    Property-file-patterns can now be specified in applicationContext.xml to enable advanced property-loading.
    Property-loading was also moved to core module.

     
  • Mirco Gatz

    Mirco Gatz - 2013-12-26
    • status: test --> closed
     
  • Mirco Gatz

    Mirco Gatz - 2013-12-26

    Tried to load properties from within a plugin. Works fine.

     

Log in to post a comment.