Controller区别RestController
时间: 2023-08-28 14:17:02 浏览: 88
spring mvc框架应用
区别在于@RestController是@ResponseBody + @Controller合体,主要用于处理RESTful风格的请求,返回的是数据而不是页面名字。而@Controller是Spring MVC框架中最基本的处理器组件,用于处理传统的HTML表单提交和页面跳转等请求,返回的是经过模板引擎渲染后的HTML页面。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Controller和RestController的区别](https://blog.csdn.net/m0_72151428/article/details/128071558)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [@controller @restcontroller 区别](https://blog.csdn.net/pipi940409/article/details/85332602)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Controller 和 RestController 详解](https://blog.csdn.net/weixin_65837469/article/details/129704949)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文