1

I have some properties configured in my spring context with <context:property-placeholder>. That works fine.

What is the best way to access a named property loaded like that, from outside of the spring context (where I have a reference to the spring ApplicationContext object).

axtavt
  • 239,438
  • 41
  • 511
  • 482
Dennis Thrysøe
  • 1,791
  • 4
  • 19
  • 31
  • http://stackoverflow.com/questions/1771166/access-properties-file-programatically-with-spring?rq=1 – Stefan Mar 04 '14 at 13:45
  • I don't see the answer in that link. I need to access the properties loaded in the context without having to load them again, knowing all the resources, etc. – Dennis Thrysøe Mar 04 '14 at 14:19

1 Answers1

0

I ended up implementing and configuring a spring Bean that has the property values injected with the @Value annotation, and then retreiving this bean from the context.

Not 100% elegant, but it works.

Dennis Thrysøe
  • 1,791
  • 4
  • 19
  • 31