Doorgaan naar hoofdcontent

Posts

Posts uit oktober, 2018 tonen

Spring overriding beans

So we have a bean of type FunkyClass and we want to override it. How? Well, we have the @Ordered annotation, which allows us to define the order when there are multiple beans of the same type. However, what happens when we only want one? Spring does not automatically take the highest order. To override a bean, you can use the @Primary annotation :)