Announcement Announcement Module
Collapse
No announcement yet.
Any way to autowire a java.util.List of Strings directly from a properties file? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Any way to autowire a java.util.List of Strings directly from a properties file?

    Hi,

    I'm using Spring 3.1.1.RELEASE on JBoss AS 7.1.0.Final. I have this defined in my application context file

    Code:
    	<util:properties id="applicationProperties" location="classpath:application.properties" />
    One of the properties looks like this:

    Code:
    	org.types.without.parents=01,02,05,16,35,51
    Is there any slick way to autowire a List or Strings from the property directly? Right now, I'm loading it like:

    Code:
        @Value("#{applicationProperties['org.types.without.parents']}")
        private String indOrgsList;
    which is fine, but then I need to apply a ".split" in the places where I reference this property. Thanks, - Dave
Working...
X