@RestController注解
@RestController简单粗暴的理解就是@[email protected][email protected]
下图所示为测试结果
效果跟@[email protected]是一样的
另外
This code uses Spring 4’s new @RestController annotation, which marks the class as
a controller where every method returns a domain object instead of a view. It’s shorthand for
@Controller and @ResponseBody rolled together.
上面是官网的解释
由上面可见,@[email protected][email protected]