-
Spring Boot 配置多个 RestTemplate 实例
场景 工程中需要配置不同处理器的RestTemplate,比如:有些场景使用默认的ErrorHandler不处理400/500异常,有些场景需要添加Interceptors拦截器。 代码 @Conf
2024-04-04, Views: 1510 , Topics: Spring Boot RestTemplate
-
Spring Boot ControllerAdvice 如何抓取 Error 异常
需求 需要捕获OutOfMemoryError、StackOverflowError等继承于Error类的错误异常。 代码 对于抓取了Exception级别的异常,都会走到这个ControllerA
2024-04-03, Views: 857 , Topics: Spring Boot
-
Spring Boot 判断请求是否为静态资源
方法 ResourceUrlProvider的getForLookupPath方法,如果是正常RESTful的请求会返回为null,如果是静态资源则会返回对应的URL。 代码 import org.
2024-04-02, Views: 1203 , Topics: Spring Boot
-
Spring Boot 获取 URL 中 PathVariable 的值
@PathVariable @GetMapping("/api/post/{postId}") public Post getPost(@PathVariable Integer postId) {
2024-04-01, Views: 953 , Topics: Spring Boot
-
Spring Boot 判断 URL 地址是否匹配 Controller 路径
PathMatcher match方法第一个参数是Controller的地址,第二个参数是需要匹配的URL地址,可以是指定的字符串或者请求的地址。 @Contr
2024-03-29, Views: 1008 , Topics: Spring Boot
-
Spring Boot 工程作为 SDK 依赖库方式自动注入 Bean 类
需求 抽取公共模块,以SDK的方式被宿主引入。在这个SDK中,自动注入@Configuration、@Bean、@Component、@Service、@Rep
2024-03-28, Views: 871 , Topics: Spring Boot
-
Spring Boot 打包成 SDK 去除 application.yaml 配置文件
Maven pom.xml 在build节点下,添加resources节点,并添加excludes规则,将application.yaml配置排除在SDK的ja
2024-03-27, Views: 1450 , Topics: Spring Boot
-
Spring Boot 报错 the request was rejected because no multipart boundary was found
错误信息 the request was rejected because no multipart boundary was found org.spri
2024-03-25, Views: 2064 , Topics: Spring Boot
-
Spring Boot 3 Thymeleaf ctx 对象
ctx Thymeleaf中提供的#ctx是WebEngineContext对象。 <p th:text="${#ctx}"></p>
2024-03-22, Views: 678 , Topics: Spring Boot Thymeleaf
-
Spring Boot 3 Thymeleaf 获取 HTTP 状态码
ctx Thymeleaf提供了#ctx可以获取Status Code。 思路 通过ctx获取到HttpServletResponse就能获取状态码了。 代码
2024-03-21, Views: 748 , Topics: Spring Boot Thymeleaf
-
Spring Boot 3 Invalid return type for async method (only Future and void supported): class java.lang.Boolean
错误信息 Invalid return type for async method (only Future and void supported): clas
2024-03-20, Views: 1725 , Topics: Spring Boot
-
Spring Boot 3.2 启用虚拟线程后 ThreadPoolTaskScheduler 报错
错误信息 *************************** APPLICATION FAILED TO START *******************
2024-03-19, Views: 1415 , Topics: Spring Boot 虚拟线程
-
Spring Boot 3 自动加载配置类新方式
说明 从Spring Boot 2.7开始,原先的自动加载方式标记为过时,Spring Boot 3中原先的方式被移除,无法通过原先的方式加载自定义自动配置类。
2024-03-18, Views: 892 , Topics: Spring Boot
-
PostgreSQL 16 编译安装
说明 以CentOS 8为例。 安装依赖 libxslt yum install libxslt-devel readline yum install readline-devel zlib y
2024-03-15, Views: 1616 , Topics: PostgreSQL
-
PostgreSQL 删除数据库时报错 ERROR: database "test" is being accessed by other users
错误信息 查询出错 (7): ERROR: database "test" is being accessed by other users DETAIL: T
2024-03-14, Views: 1007 , Topics: PostgreSQL
-
Flowable 工作流集成到 Spring Boot 工程
添加依赖 全部功能 包含所有Flowable引擎的功能:Process、CMMN、DMN、IDM。 <dependency> <gro
2024-03-13, Views: 899 , Topics: Flowable Spring Boot
-
Flowable 配置不同数据库 Schema 做到数据隔离
需求 后端服务使用了PostgreSQL,有自己的数据库,不想让Flowable的数据库在业务的数据库中。 实现 使用PostgreSQL的不同Schema,但
2024-03-12, Views: 1458 , Topics: Flowable Spring Boot
-
Flowable 配置单独数据库
环境 Spring Boot 3、Flowable 7。 代码 yaml 配置 flowable: datasource: url: jdbc:po
2024-03-11, Views: 1183 , Topics: Flowable Spring Boot
-
Flowable UI 建模工具搭建
Docker 说明 Flowable 7商业化之后不再提供UI,需要使用他的在线网站,不但需要注册登录,而且商用30天试用。 拉取镜像 docker pull
2024-03-08, Views: 1351 , Topics: Flowable
-
Flowable 打印 SQL 语句
配置 logging: level: org.flowable.engine.impl.persistence.entity.*: debug
2024-03-07, Views: 775 , Topics: Flowable