I want to define RequestMapping using the value inside a properties file (file inside resource folder).
@RequestMapping(value = "X", produces = "application/json") public String hello() { } How can I read "X" from a properties file?
EDIT: I try with @PropertySource annotation, but it doesn't work in "X"
EDIT 2: I also try this, and it works but not in @RequestMapping(value = "X")
@Bean public static PropertySourcesPlaceholderConfigurer placeHolderConfigurer() { PropertySourcesPlaceholderConfigurer propertyConfigurer = new PropertySourcesPlaceholderConfigurer(); propertyConfigurer.setLocations(new PathMatchingResourcePatternResolver().getResources("classpath:/**/abc.properties")); return propertyConfigurer; } Thanks