I have a property file that is configured within spring context xml file. I load values from the file fine.
I am trying to load a property from that property file in a regular pojo which is not spring managed. Since Spring has already loaded that property, i was wondering if there is a way to get the value instead of me having to load the property file manually?
I have a property file that is configured within spring context xml file. I
Share
You can access the Spring context in a static way if your pojo is not managed by Spring.
Add a bean to your application xml:
Create a class:
Then you can acces any Spring bean from your POJO using: