Spring / Spring interview questions
How do I Inject value into static variables in Spring bean?
Spring does not allow injecting to public static non-final fields. So the workaround will be changing to private modifier.
Another workaround will be to create a non static setter to assign the injected value for the static variable.
@Value("${my.name}") public void setName(String privateName) { ThisClass.name = privateName; }
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
More Related questions...