I want to load a property file into a spring bean. I found two approaches :
- configure in xml as
<util.properties>
and inject using@Resource
or@Autowired
- Use @PropertySource along with the @Configuration bean.
I do not want to create @configuraiton bean for this scenario since all spring configurations are maintained in xml.
If i follow the first approach - i dont have the below option to handle the scenario of missing property file @PropertySource(value="classpath:missing.properties", ignoreResourceNotFound=true)
I want the entire property file to be injected since this is lookup file and different keys will be accessed based on the logic. ( hence the context property place holder will not help )
Is there any way i can inject a property file into a bean and also handle the missing file scenario ?