Jokes aside, I'd say B and E are the clear winners here. The @Controller is a core Spring MVC annotation, and it's indeed a stereotype like @Component. Gotta love that Spring ecosystem!
Haha, A is so wrong. The whole point of a @Controller is to handle requests, not just render views. Someone's been watching too much JSP code, I think.
I think C is a bit misleading. The @Controller classes don't need to be annotated with @EnableMvcMappings to be discovered via component scanning. That's just an extra configuration step.
Hmm, D is definitely not true. @Controller and @RestController are not interchangeable, as they serve different purposes. You can't just swap them without changing the method implementations.
B and E are the correct answers. The @Controller annotation is used to mark a class as a Spring MVC controller, which can handle requests in the Spring MVC framework. It's also a stereotype annotation like @Component.
Annett
4 months agoVeronika
4 months agoOretha
3 months agoVesta
3 months agoArthur
4 months agoMendy
4 months agoLizette
4 months agoKenneth
4 months agoLashawn
3 months agoLashawn
4 months agoElina
4 months agoMickie
4 months agoTori
3 months agoFidelia
3 months agoJesusita
4 months agoArthur
5 months ago