首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

SpringBoot框架_skynet框架详解

1.SpringBoot优点 • Create stand-alone Spring applications • 创建独立Spring应用 • Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files) • 内嵌web服务器 • Provide opinionated ‘starter’ dependencies to simplify your build configuration • 自动starter依赖,简化构建配置 • Automatically configure Spring and 3rd party libraries whenever possible • 自动配置Spring以及第三方功能 • Provide production-ready features such as metrics, health checks, and externalized configuration • 提供生产级别的监控、健康检查及外部化配置 • Absolutely no code generation and no requirement for XML configuration • 无代码生成、无需编写XML SpringBoot是整合Spring技术栈的一站式框架 SpringBoot是简化Spring技术栈的快速开发脚手架

01

springBoot注解与分析

@SpringBootApplication:包含了@ComponentScan、@Configuration和@EnableAutoConfiguration注解。 @ComponentScan让spring Boot扫描到Configuration类并把它加入到程序上下文。 @Configuration 等同于spring的XML配置文件;使用Java代码可以检查类型安全。 @EnableAutoConfiguration 自动配置。 @ComponentScan 组件扫描,可自动发现和装配一些Bean。 @Component可配合CommandLineRunner使用,在程序启动后执行一些基础任务。 @RestController注解是@Controller和@ResponseBody的合集,表示这是个控制器bean,并且是将函数的返回值直 接填入HTTP响应体中,是REST风格的控制器。 @Autowired自动导入。 @PathVariable获取参数。 @JsonBackReference解决嵌套外链问题。 @RepositoryRestResourcepublic配合spring-boot-starter-data-rest使用。

01
领券