Return to site
SPRING CERTIFICATION QUESTION: What is the difference between '@Controller' and '@RestController'?
SPRING CERTIFICATION QUESTION: What is the difference between '@Controller' and '@RestController'?
·
'@RestController' is a compound annotation,
which is meta-annotated with '@Controller'and '@ResponseBody' annotations.
Thus response-request bodies are a subject of http-converters omitting view-model phase.
One might prefer to use '@Controller' and '@ResponseBody' annotations instead;
'@RestController' is just a convenience annotation.
#spring #certificationquestion #vcp