随笔分类 -  springboot

摘要:相对于传统的单体架构,微服务架构引入了太多的概念,让新手有点无可适从。所以,我们要清楚哪些是自身需要的。下面我们分析一下哪些组件是开发一个使用微服务架构的系统所必需的。 使用微服务架构进行开发的4个步骤如下。 ① 沿用组织中现有的技术体系开发具有单一功能的微服务。 ② 服务提供方将地址信息注册到注册 阅读全文
posted @ 2022-12-14 09:02 cnetsa 阅读(100) 评论(0) 推荐(0) 编辑
摘要:spring-boot-starters是Spring Boot的启动器,它可以一站式打包Spring及相关技术应用,而不需要开发者到处寻找依赖和示例来配置代码。 开发者只要启动spring-boot-starters 中的spring-boot-starter-web启动器,该模块就会自动配置 W 阅读全文
posted @ 2022-12-13 22:04 cnetsa 阅读(24) 评论(0) 推荐(0) 编辑
摘要:spring-boot-autoconfigure能根据类路径下的内容自动配置,提供的@EnableAutoConfiguration注解能启用Spring Boot的自动配置功能。自动配置功能可以推断开发者可能需要加载哪些Spring Bean,例如,如果类路径下有一个连接池的包,此时并未提供任何 阅读全文
posted @ 2022-12-13 22:03 cnetsa 阅读(189) 评论(0) 推荐(0) 编辑
摘要:spring-boot是Spring Boot的主模块,也是支持其他模块的核心模块,主要功能包含以下几点。 (1)提供了一个用于启动 Spring 应用的主类,它的主要作用是创建和刷新Spring容器的上下文。 (2)提供了内嵌式的并可自由选择搭配的Web应用容器,例如,Tomcat、Jetty、U 阅读全文
posted @ 2022-12-13 22:02 cnetsa 阅读(25) 评论(0) 推荐(0) 编辑
摘要:JSP的依赖 <!-- JSP的依赖--> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> </dependency> 阅读全文
posted @ 2022-12-13 12:01 cnetsa 阅读(75) 评论(0) 推荐(0) 编辑
摘要:JSR-303校验 <!-- JSR-303校验--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </depende 阅读全文
posted @ 2022-12-13 12:00 cnetsa 阅读(27) 评论(0) 推荐(0) 编辑
摘要:<!-- 数据源信息--> <!-- <dependency>--> <!-- <groupId>org.springframework.boot</groupId>--> <!-- <artifactId>spring-boot-starter-jdbc</artifactId>--> <!-- 阅读全文
posted @ 2022-12-13 11:58 cnetsa 阅读(52) 评论(0) 推荐(0) 编辑
摘要:<!-- 监控--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> 阅读全文
posted @ 2022-12-13 11:57 cnetsa 阅读(38) 评论(0) 推荐(0) 编辑
摘要:pom之 热部署spring-boot-devtools <!-- 热部署 Ctrl+Shift+Alt+/ --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</ 阅读全文
posted @ 2022-12-13 11:57 cnetsa 阅读(42) 评论(0) 推荐(0) 编辑
摘要:spring-boot-starter-web <!-- web模块--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </depe 阅读全文
posted @ 2022-12-13 11:56 cnetsa 阅读(78) 评论(0) 推荐(0) 编辑
摘要:import org.springframework.beans.factory.annotation.Autowired; @Autowired import org.springframework.beans.factory.annotation.Value; @Value("${student 阅读全文
posted @ 2022-12-13 11:47 cnetsa 阅读(9) 评论(0) 推荐(0) 编辑
摘要:package com.example.demo.entity; import lombok.Data; import org.springframework.stereotype.Component; import org.springframework.boot.context.properti 阅读全文
posted @ 2022-12-13 11:46 cnetsa 阅读(119) 评论(0) 推荐(0) 编辑
摘要:package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** 阅读全文
posted @ 2022-12-13 11:44 cnetsa 阅读(65) 评论(0) 推荐(0) 编辑
摘要:# SpringBoot项目的配置文件 server: # 项目的运行端口号 port: 8888 servlet: # 项目访问路径 context-path: /demo 阅读全文
posted @ 2022-12-13 11:42 cnetsa 阅读(22) 评论(0) 推荐(0) 编辑
摘要:spring: # 应用名称 application: name: demo datasource: # 驱动如果是8+,那么driverClass和url都需要改变,url需要添加serverTimezone=UTC driver-class-name: com.mysql.jdbc.Driver 阅读全文
posted @ 2022-12-13 11:41 cnetsa 阅读(8) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示