I have a Spring Boot application with a YAML configuration that contains a feature list like this: I would like to use @ConditionalOnExpression to conditionally initialize beans related to those features, identifying them by keys. Since “features” property is a list, it seems I need collection selection to do this. I have tried these two options for the annotation’s value:
Tag: spring-el
Spring SPEL collection projection
A simple question on SPEL collection selection. Look at section 10.5.17 Collection Selection on this page https://docs.spring.io/spring/docs/4.3.10.RELEASE/spring-framework-reference/html/expressions….
Injecting property in Springboot using @Value annotation
I am using Spring and Java for an application, and I want to use the @Value annotation to inject the value of the property, my use case is that I want first to check if that property exists as system …
convert SpEL output to long to use as an annotation argument
Currently, I can use String arguments using SpEL as follows: @Autowired private ParameterService parameterService; @Scheduled(cron = “#{parameterService.findByCode(‘cron’)}”) It works fine but if I …
How to fill HashMap from java property file with Spring @Value
Is it possible to use Spring @Value, to map values from properties file to the HashMap. Currently I have something like this, and mapping one value is not a problem. But I need to map custom values in HashMap expirations. Is something like this possible? Property file: ‘my_service.properties’ Is it posible to map like this key:value set name1 = 100