Statically spilling your (Spring) Beans

Accessing Spring Beans from a static method

To make it abundantly clear: You should always try to refactor your code so you do not need this approach (something I’ll dive into in a follow up blogpost I’m working on). There may be some edge cases where there truly is no other way but those situations are rare. Always try to refactor! Using this method can lead to multiple unexpected and hard to debug issues as it does not follow the regular Spring Framework concepts. [Read More]