Related questions
Spring overriding primary bean with non-primary bean
I am trying to override a Spring bean during a test declared in a test configuration with the use of @Primary. One declaration is in the src/main/java path, the other, the primary, is in src/test/java path.
…
exclude @Component from @ComponentScan
I have a component that I want to exclude from a @ComponentScan in a particular @Configuration:
@Component("foo") class Foo {
...
}
Otherwise, it seems to clash with some other class in my project. I don't fully understand the collision, but if …
Spring @Autowired and @Value on property not working
I would like to use @Value on a property but I always get 0(on int).
But on a constructor parameter it works.
Example:
@Component
public class FtpServer {
@Value("${ftp.port}")
private int port;
public FtpServer(@Value("${ftp.port}") int port) {
…