springframework springboot annotation autowired

springboot 日志

<logger name="com.sinoservices.chainwork.bms" level="INFO" /><logger name="org.hibernate.orm.deprecation" level="error"/><logger name="druid" additivi ......
springboot 日志

SpringBoot+Prometheus+Grafana监控服务

服务模块 pom.xml文件引入依赖 ####基于SpringBoot版本 <2.5.3> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> <v ......
SpringBoot Prometheus Grafana

27-springboot-thymeleaf内置对象

1、内置web对象 thymaleaf内置的web对象,可以直接在模板中使用,这些对象由#号开头: #request: 相当于HttpServletRequest 对象,这是Thymeleaf 3.x版本,若是Thymeleaf 2.x版本使用 #httpServletRequest; ${#req ......

26-springboot-thymeleaf字符串拼接-常量-符号

Thymeleaf 字符串拼接 一种是字符串拼接: <span th:text="'当前是第'+${sex}+'页 ,共'+${sex}+'页'"></span> 另一种更简洁的方式,使用“|”减少了字符串的拼接: <span th:text="|当前是第${sex}页,共${sex}页|"></s ......

25-springboot-thymeleaf的常见属性

th:action <form id="login" th:action="@{/login}">......</form> th:method <form id="login" th:action="@{/login}" th:method="post">......</form> th:href ......

24-springboot-thymeleaf的表达式

1.添加热部署,为了测试不用频繁重启 <!--热部署插件--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</ ......

23-springboot集成thymeleaf

Spring Boot 官方推荐前端不使用JSP,推荐使用thymeleaf来替代JSP技术; Thymeleaf是一种模板技术,该模板技术也采用Java语言开发的; 但是thymeleaf是另外一家公司开源做的,并不属于springboot,springboot只是很好地集成这种模板技术,作为前端 ......
springboot thymeleaf 23

动力节点王鹤SpringBoot3学习笔记——第四章 访问数据库

目录 第四章 访问数据库 4.1 DataSource 4.2 轻量的JdbcTemplate 4.2.1 准备环境 4.2.1.1 准备数据库和表脚本 4.2.1.2 创建Spring Boot工程 4.2.2 JdbcTemplate访问MySQL 4.2.3 NamedParameterJdb ......

22-springboot应用监控-actuator

可以做成页面监控(springboot-admin),而不是json的格式,看起来会更方便。 在生产环境中,有时可能需要监控服务的可用性,spring-boot 的 actuator 就是提供了对应用的配置查看、健康检查、相关功能统计等,可以通过HTTP,JMX来访问这些监控功能;(端点) 如何使用 ......
springboot actuator 22

idea 调试本地springboot微服务,设置不向eureka注册服务

背景dev 环境只有一个eureka 注册中心,企业多人同时本地调试服务,而 dev 服务器环境与个人本地网络不联通,如果个人将本地微服务注册到 eureka 注册中心,dev 上的服务调用微服务时,势必会因为 ribbon 负载均衡,将请求打到个人本地的服务上,但 dev 服务器与本地服务网络又不 ......
springboot eureka idea

org.springframework.beans.factory.BeanDefinitionStoreException版本问题

运行背景 学习Spring aop的时候,运行一个测试用例,报了如下错误信息。 报错日志 org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document ......

Springboot与Springcloud

springboot介绍 其实springboot就是一个maven项目,只不过使用了spring提供的多个starter来加载多个相关依赖包,starter简单说就是maven包的组合。 比如:只需要一个web的starter包就能直接启动web服务 <dependency> <groupId>o ......
Springcloud Springboot

SpringBoot大文件上传解决方案支持分片断点上传

​ PHP用超级全局变量数组$_FILES来记录文件上传相关信息的。 1.file_uploads=on/off 是否允许通过http方式上传文件 2.max_execution_time=30 允许脚本最大执行时间,超过这个时间就会报错 3.memory_limit=50M 设置脚本可以分配的最大 ......
断点 SpringBoot 解决方案 文件 方案

20-springboot打包部署

1.打war包 1. 程序入口类需扩展继承 SpringBootServletInitializer 类 2、程序入口类覆盖如下方法: @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder ap ......
springboot 20

Spring探索丨既生@Resource,何生@Autowired?

读了本文你将会了解到:1、@Resource和@Autowired来源;2、Spring官方为什么会支持这两个功能如此相似的注解?3、为什么@Autowired属性注入的时候Idea会曝出黄色的警告?4、@Resource和@Autowired推荐用法 ......
Autowired Resource Spring

SpringBoot集成Activiti7-单独配置数据源

框架:SpringBoot + Mybatis + Activiti7 思路: 单独给mybatis和activiti配置datasource Mybati配置单数据源方法 单数据源只需要在yml中配置 url: jdbc:mysql://localhost:3306/localtest?serve ......

site-packages/flask/json/init.py from future import annotations future feature annotation is not defined

如果在使用 Flask 库时,出现了“future feature annotations is not defined”的错误,可能是因为 Python 解释器版本太低。在 Python 3.7 及以下版本中,from __future__ import annotations 是不支持的,因此需 ......

Springboot 系列 (27) - Springboot+HBase 大数据存储(五)| HBase REST 服务

REST (Representational State Transfer) 即表述性状态传递,是 Roy Fielding 博士 2000 年在他的博士论文中提出来的一种软件架构风格。它是一种针对网络应用的设计和开发方式,可以降低开发的复杂性,提高系统的可伸缩性。在三种主流的 Web 服务实现方案 ......
Springboot HBase 数据 REST 27

springboot集成mybatis-plus

springboot项目 先导入相关依赖mybatis-plus相关依赖 <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.0.5</v ......
mybatis-plus springboot mybatis plus

springboot起步依赖

<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.0.RELEASE</version> <relativePat ......
springboot

SpringBoot中操作Redis通过所有可能的key查询存在的key并解析为对象实体的通用方法

场景 SpringBoot中操作Redis的特殊操作-批量查询(通过key的集合批量查杜绝模糊搜索)、查询并解析对象list: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/129896929 在上面讲操作redis中特殊操作时, ......
SpringBoot 实体 key 对象 方法

springboot学习笔记1-基本介绍

springboot基本介绍 官方文档 什么是springboot spring boot可以轻松创建独立的、生产级的基于spring的应用程序 spring boot直接嵌入tomcat、jetty、或undertow, 无须打war包,可以直接运行spring boot应用程序 quicksta ......
springboot 笔记

SpringBoot 热部署

在开发过程中,通常会对业务代码不断地修改测试,在修改之后往往需要重启服务,有些服务需要加载很久才能启动成功,这种重复操作极大的降低了程序开发效率。Spring Boot框架专门提供了进行热部署的依赖启动器spring-boot-devtools,用于进行项目热部署,而无需手动重启项目。 具体实现步骤 ......
SpringBoot

springboot提供的异步调用

Spring Boot提供了许多异步调用的选项,其中最常用的是使用@Async注释和CompletableFuture类。 @Async注释可用于将任何方法标记为异步方法。使用该注释时,Spring Boot将在后台创建一个新线程池,并将方法调用委派给该线程池。异步方法的返回值必须是void或Fut ......
springboot

SpringBoot的@Async注释的用法并例子

在Spring Boot中,@Async注解用于将一个方法标记为异步执行的方法。使用该注解的方法将在一个单独的线程中异步执行,而不会阻塞调用线程。这对于处理需要长时间运行的任务或需要异步处理的任务非常有用。 下面是一个简单的示例: @Service public class MyService { ......
注释 SpringBoot 例子 Async

springboot-监听器

监听器 ApplicationListener可以实现这个接口时传入对应的监听器,用于监听该事件 比如:实现 ApplicationListener<ContextRefreshedEvent> 接口,重写 onApplicationEvent 方法,将 ContextRefreshedEvent ......
监听器 springboot

SpringBoot中Mybatis的应用

创建一个SpringBoot项目,然后如下操作: (1) 添加Lombok插件--简化实体类 (2)添加Mybatis框架和MySQL驱动 访问Mysql和使用Mybatis (3)创建pojo包和实体类 在项目中创建pojo包,并在其中创建实体类。实体类上可以使用Lombok注解。首次使用时,需要 ......
SpringBoot Mybatis

SpringBoot定时任务

##使用注解@Scheduled 1.在启动类上添加注解@EnableScheduling开启定时任务 2.创建定时任务 @Component public class StatisticsComp { /** * 日统计(每日0点1分触发) */ @Scheduled(cron = "0 1 0 ......
SpringBoot 任务

springboot-自己开发start

步骤 命名规范 第三方在建立自己的 Starter 的时候命名规则统一用xxx-spring-boot-starter, 官方提供的 Starter 统一命名方式为spring-boot-starter-xxx。 步骤 新建一个Maven项目,在pom.xml文件中定义好所需依赖; 新建配置类,写好 ......
springboot start

【SpringBoot】关闭MyBatisPlus启动图标(banner)

去掉此图标 配置文件:application.yml 添加内容: mybatis-plus: global-config: banner: false ......
MyBatisPlus SpringBoot 图标 banner