Spring @DependsOn

Use @DependsOn to make Spring initialize other beans before the annotated one. Usually, this behavior is automatic.

@DependsOn("engine")
class Car implements Vehicle {}
@Bean
@DependsOn("fuel")
Engine engine() {
    return new Engine();
}

你可能感兴趣的:(框架,spring,java,servlet)