Analog of spring @Controller annotation in Java config

Viewed 705

In Spring DI I love to use @Bean with factory method in @Configuration class instead of using @Component annotation explicitly. Is there a way to do the same with @Controller annotation for Spring Web? In another words, could I declare controller via factory method in some @Configuration class instead of explicit annotation?

1 Answers
Related