@Controller和@RestController的区别?
发布日期:2021-05-10 01:18:54 浏览次数:18 分类:精选文章

本文共 3267 字,大约阅读时间需要 10 分钟。

Spring Boot������������@Controller���������@ResponseBody���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������JSP���������HTML���������������������������������������������������������JSON���XML������������MIME������������������������������������InternalResourceViewResolver���������������������������������������������������������������������������������������������������������������

���������@RestController���@RequestBody���Spring Boot���������������������������������@RestController������������������������������������������RESTful���������������������������������������JSON���XML���������������������������������������@Controller������������������������������JSP���������HTML������������������������������������������InternalResourceViewResolver���InternalResourceViewResolver���������������������������������������������������������������������������������������������

���������������Controller������������������������������������������InternalResourceViewResolver������Spring Boot���������������application.properties������������������������������

spring.view.internalResourceViewResolver.locationPrefix = /templates/
spring.view.internalResourceViewResolver.view_class = .html

���������InternalResourceViewResolver���������������������������������������������������HTML������������������������������������������������������������������������������������@ModelAttribute���������

���������������������������JSON���XML������������MIME������������������@RequestBody���������������������HTTP������������������������Java���������������������API���������������������������@ResponseBody������������������Spring Boot������������������������������������������������������������������������������������������������������

���������������������������JSON������������������Controller���������������@ResponseBody���������������������������������������MIME������������������������������������produce="application/vnd.mycompany.myschema"���������������������Spring Boot���������������������������Converter������������ Jackson JSON������������O XML������������������������������������������������������������������������������������������JSON������������������������List���������������Spring Boot������������������������JSON���������

������������������������������������������������������API���������������������������������������������������200 OK������������������������������������������������������������������������������������������403 Forbidden���404 Not Found���409 Conflict������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@���������� ���� @BufferSize���������������������������������������������������������������������������������������������

���������������������������������������������Spring Boot������������������������@Controller���@RequestBody���@ResponseBody���InternalResourceViewResolver���������������������������������������������������������������������������������������������������Spring oficial documentation������������������������������������������������������������������������������������

上一篇:【程序员必备】:IDEA设置为豆沙绿
下一篇:ICMP

发表评论

最新留言

哈哈,博客排版真的漂亮呢~
[***.90.31.176]2025年04月20日 02时55分57秒