I want to use the @Value annotation to inject a Double property such as:
@Service
public class MyService {
@Value(\"${item.priceFactor}\")
private D
Try changing the following line
@Value("${item.priceFactor}")
to
@Value("#{new Double('${item.priceFactor}')}")
How about storing a String and converting to numbers like integers and doubles through getters and setters? For safe code with Java injection you should always use getters and setters and only for other methods in any case. I advice you warmly to read about java security (Which is NOT for hackers), but more for code usage and writing likewise the one you uploaded, wich uses injection.
This should solve the problem-
@Value("#{T(Double).parseDouble('${item.priceFactor}')}")
private Double priceFactor;