• HOME
  • SEARCH
  • TOPICS
  • DATA

  • Spring Boot 使用 Jib 打包成 Docker 镜像

    Maven 插件 使用本地镜像:以docker://标识。 默认的基础镜像是openjdk:11-jre,每次都会去镜像仓库拉取。 <plugin>

    2023-01-26, Views: 2070 , Topics: Spring Boot Docker

  • Spring Boot 使用 Java16 新特性 record 绑定配置文件属性

    配置文件 blog: portal: title: Blog author: fendoudebb keywords: Java,

    2023-01-25, Views: 1640 , Topics: Spring Boot

  • Spring Boot 将 InputStream 输入流转换为 String

    StreamUtils Spring中提供了StreamUtils工具类,将InputStream转换为String。 注意:不会关闭流。 使用 假设转换Htt

    2023-01-23, Views: 3177 , Topics: Spring Boot

  • Spring Boot 防重放攻击原理及代码实现

    重放攻击 API重放攻击(Replay Attacks)又称重播攻击、回放攻击,这种攻击会不断恶意或欺诈性地重复一个有效的API请求。攻击者利用网络监听或者其他

    2023-01-23, Views: 2841 , Topics: Spring Boot Security

  • Spring Boot 3 使用 Spring Native 构建二进制可执行文件

    JDK 使用Liberica Native Image Kit版本的JDK,内置了native-image命令。 最主要是:GraalVM没有自带native-

    2023-01-22, Views: 2377 , Topics: Spring Boot GraalVM

  • Spring Boot 注入 Filter 过滤器的几种方式

    FilterRegistrationBean 推荐使用FilterRegistrationBean方式。 @Configuration(proxyBeanMet

    2023-01-21, Views: 1974 , Topics: Spring Boot

  • Spring Boot 中 Filter 和 Interceptor 区别

    Filter 容器(如:Tomcat)提供的过滤器。 Interceptor 作用域 Filter作用于Servlet。 Interceptor在Spring提

    2023-01-20, Views: 1359 , Topics: Spring Boot

  • Spring Cloud OpenFeign MultipartException 上传文件异常

    错误信息 错误一:MultipartException MultipartException: Current request is not a multipa

    2022-10-26, Views: 2786 , Topics: Spring Boot OpenFeign

  • Spring Cloud OpenFeign 自定义 ErrorDecoder

    示例代码 配置类 形参中注入Decoder(默认启动时就会注入Decoder,参见默认配置FeignClientsConfiguration),解析respon

    2022-10-25, Views: 2226 , Topics: OpenFeign Spring Boot

  • Spring Cloud OpenFeign 使用指定配置

    需求 因为OpenFeign被添加在公共库中,且注入到了全局Decoder,所有Feign客户端都使用了@Decoder。 有特殊的客户端不适用全局Decode

    2022-10-24, Views: 2036 , Topics: Spring Boot OpenFeign

  • 从源码到镜像:使用 Docker 多阶段构建 Spring Boot 镜像

    多阶段构建 阶段一 使用Maven打包,拷贝工程源码、pom.xml文件。 阶段二 从阶段一拷贝构建好的jar包,配置运行参数等,完成 Spring Boot

    2022-10-23, Views: 1998 , Topics: Spring Boot Docker Maven

  • SpringMVC 使用对象接收 GET 请求参数 QueryString

    需求 将问号后的请求参数封装到对象中。 http://localhost:8080/hello?ids=1&ids=2&name=test Co

    2022-10-22, Views: 2051 , Topics: SpringMVC Spring Boot

  • Spring Boot 移除指定配置

    移除 @Bean 标注的对象 @SpringBootApplication的exclude属性。 适用于@Configuration标注的类。 @SpringB

    2022-10-21, Views: 2038 , Topics: Spring Boot

  • 自定义 Spring Boot Starter 中的组件无法被 Spring 扫描注册

    现象 自定义starter包中的@Controller、@Service、@Component、@Bean等对象没有注入到Spring容器中。 原因 主项目包c

    2022-10-20, Views: 2975 , Topics: Spring Boot

  • Spring Boot @ComponentScan exclude 不起作用

    现象 使用了@ComponentScan的excludeFilters但不起作用。 示例代码 @ComponentScan(excludeFilters = @

    2022-10-19, Views: 3812 , Topics: Spring Boot

  • Spring Boot 使用 Mockito 进行单元测试

    示例 @ExtendWith({MockitoExtension.class}) public class HelloServiceTests { @

    2022-10-18, Views: 1697 , Topics: Spring Boot 单元测试

  • Spring Boot 单元测试 MockMvc 模拟 HTTP 请求

    MockMvc @WebMvcTest标注的单元测试类中,可以注入MockMvc对象。 @SpringBootTest标注的单元测试类,还需要加@AutoCon

    2022-10-17, Views: 2696 , Topics: Spring Boot 单元测试 HTTP

  • Spring Boot 单元测试 @WebMvcTest 对 Controller 进行单独测试

    需求 只能Controller中的逻辑进行单元测试,Service层不进行测试。 @MockBean 使用@MockBean模拟Service层,给定Servi

    2022-10-16, Views: 2186 , Topics: Spring Boot 单元测试

  • Spring Boot 单元测试 @MockBean 模拟依赖注入

    @MockBean 使用@MockBean标识注入的Component是模拟的,不会运行真实的组件逻辑,需要自己给定假设的返回值。 假设返回值 使用given(

    2022-10-15, Views: 2970 , Topics: Spring Boot 单元测试

  • Spring Boot 获取 HttpServletRequest 的几种方式

    方法一 SpringMVC会隐式注入HttpRequest @RestController public class TestController {

    2022-10-14, Views: 3100 , Topics: Spring Boot

  • First Prev
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • Next Last

©2025 沪ICP备18012661号-1 阿里云

Messages Sitemap GitHub