SpringBoot中内置的49个常用工具类

SpringBoot中内置的常用工具类 本文介绍了SpringBoot框架中49个实用工具类,涵盖字符串处理、集合操作、反射处理、I/O操作、Web开发、数据验证等多个领域。重点展示了StringUtils、CollectionUtils、ReflectionUtils、FileCopyUtils等常用工具类的核心功能和使用示例,如空字符串检查、集合合并、反射调用方法、文件复制等。这些工具类能够显著减少样板代码,提高开发效率,帮助开发者构建更健壮的应用程序。文章建议开发者深入了解Spring生态系统的工具类,以充分发挥框架优势,优化日常开发工作流 阅读详情

👉 这是一个或许对你有用的社群

🐱 一对一交流/面试小册/简历优化/求职解惑,欢迎加入「芋道快速开发平台」知识星球。下面是星球提供的部分资料: 

👉这是一个或许对你有用的开源项目

国产Star破10w的开源项目,前端包括管理后台、微信小程序,后端支持单体、微服务架构

RBAC权限、数据权限、SaaS多租户、商城、支付、工作流、大屏报表、ERP、CRM、AI大模型、IoT物联网等功能:

  • 多模块:https://gitee.com/zhijiantianya/ruoyi-vue-pro

  • 微服务:https://gitee.com/zhijiantianya/yudao-cloud

  • 视频教程:https://doc.iocoder.cn

【国内首批】支持 JDK17/21+SpringBoot3、JDK8/11+Spring Boot2双版本 

来源:风象南


SpringBoot以其强大的自动配置和丰富的生态系统成为Java开发的首选框架。

除了核心功能外,SpringBoot及其依赖的Spring框架还包含大量实用工具类,它们可以显著简化日常开发工作。

本文将介绍49个常用工具类,并通过简洁的代码示例展示它们的基本用法。

字符串处理工具类

1. StringUtils
import org.springframework.util.StringUtils;

// 检查字符串是否为空
boolean isEmpty = StringUtils.isEmpty(null);  // true
boolean isEmpty2 = StringUtils.isEmpty("");  // true

// 检查字符串是否有文本内容
boolean hasText = StringUtils.hasText("  ");  // false
boolean hasText2 = StringUtils.hasText("hello");  // true

// 分割字符串
String[] parts = StringUtils.tokenizeToStringArray("a,b,c", ",");

// 清除首尾空白
String trimmed = StringUtils.trimWhitespace("  hello  ");  // "hello"
2. AntPathMatcher
import org.springframework.util.AntPathMatcher;

AntPathMatcher matcher = new AntPathMatcher();
boolean match1 = matcher.match("/users/*", "/users/123");  // true
boolean match2 = matcher.match("/users/**", "/users/123/orders");  // true
boolean match3 = matcher.match("/user?", "/user1");  // true

// 提取路径变量
Map<String, String> vars = matcher.extractUriTemplateVariables(
    "/users/{id}", "/users/42");  // {id=42}
3. PatternMatchUtils
import org.springframework.util.PatternMatchUtils;

boolean matches1 = PatternMatchUtils.simpleMatch("user*", "username");  // true
boolean matches2 = PatternMatchUtils.simpleMatch("user?", "user1");  // true
boolean matches3 = PatternMatchUtils.simpleMatch(
    new String[]{"user*", "admin*"}, "username");  // true
4. PropertyPlaceholderHelper
import org.springframework.util.PropertyPlaceholderHelper;

PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper("${", "}");
Properties props = new Properties();
props.setProperty("name", "World");
props.setProperty("greeting", "Hello ${name}!");

String result = helper.replacePlaceholders("${greeting}", props::getProperty);
// "Hello World!"

基于 Spring Boot + MyBatis Plus + Vue & Element 实现的后台管理系统 + 用户小程序,支持 RBAC 动态权限、多租户、数据权限、工作流、三方登录、支付、短信、商城等功能

  • 项目地址:https://github.com/YunaiV/ruoyi-vue-pro

  • 视频教程:https://doc.iocoder.cn/video/

集合和数组工具类

5. CollectionUtils
import org.springframework.util.CollectionUtils;

// 检查集合是否为空
boolean isEmpty = CollectionUtils.isEmpty(null);  // true
boolean isEmpty2 = CollectionUtils.isEmpty(Collections.emptyList());  // true

// 集合操作
List<String> list1 = Arrays.asList("a", "b", "c");
List<String> list2 = Arrays.asList("b", "c", "d");
Collection<String> intersection = CollectionUtils.intersection(list1, list2);  // [b, c]

// 合并集合
List<String> target = new ArrayList<>();
CollectionUtils.mergeArrayIntoCollection(new String[]{"a", "b"}, target);
6. MultiValueMap
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
map.add("colors", "red");
map.add("colors", "blue");
map.add("sizes", "large");

List<String> colors = map.get("colors");  // [red, blue]
7. ConcurrentReferenceHashMap
import org.springframework.util.ConcurrentReferenceHashMap;

// 创建高并发场景下的引用Map (类似WeakHashMap但线程安全)
Map<String, Object> cache = new ConcurrentReferenceHashMap<>();
cache.put("key1", new LargeObject());
8. SystemPropertyUtils
import org.springframework.util.SystemPropertyUtils;

// 解析含系统属性的字符串
String javaHome = SystemPropertyUtils.resolvePlaceholders("${java.home}");
String pathWithDefault = SystemPropertyUtils.resolvePlaceholders(
    "${unknown.property:default}");  // "default"

基于 Spring Cloud Alibaba + Gateway + Nacos + RocketMQ + Vue & Element 实现的后台管理系统 + 用户小程序,支持 RBAC 动态权限、多租户、数据权限、工作流、三方登录、支付、短信、商城等功能

  • 项目地址:https://github.com/YunaiV/yudao-cloud

  • 视频教程:https://doc.iocoder.cn/video/

反射和类处理工具

9. ReflectionUtils
import org.springframework.util.ReflectionUtils;

// 获取类的字段
Field field = ReflectionUtils.findField(Person.class, "name");
ReflectionUtils.makeAccessible(field);
ReflectionUtils.setField(field, person, "John");

// 调用方法
Method method = ReflectionUtils.findMethod(Person.class, "setAge", int.class);
ReflectionUtils.makeAccessible(method);
ReflectionUtils.invokeMethod(method, person, 30);

// 字段回调
ReflectionUtils.doWithFields(Person.class, field -> {
    System.out.println(field.getName());
});
10. ClassUtils
import org.springframework.util.ClassUtils;

// 获取类名
String shortName = ClassUtils.getShortName("org.example.MyClass");  // "MyClass"

// 检查类是否存在
boolean exists = ClassUtils.isPresent("java.util.List", null);  // true

// 获取所有接口
Class<?>[] interfaces = ClassUtils.getAllInterfaces(ArrayList.class);

// 获取用户定义的类加载器
ClassLoader classLoader = ClassUtils.getDefaultClassLoader();
11. MethodInvoker
import org.springframework.util.MethodInvoker;

MethodInvoker invoker = new MethodInvoker();
invoker.setTargetObject(new MyService());
invoker.setTargetMethod("calculateTotal");
invoker.setArguments(new Object[]{100, 0.2});
invoker.prepare();
Object result = invoker.invoke();
12. BeanUtils
import org.springframework.beans.BeanUtils;

// 复制属性
Person source = new Person("John", 30);
Person target = new Person();
BeanUtils.copyProperties(source, target);

// 实例化类
Person newPerson = BeanUtils.instantiateClass(Person.class);

// 查找方法
Method method = BeanUtils.findMethod(Person.class, "setName", String.class);

I/O和资源工具

13. FileCopyUtils
import org.springframework.util.FileCopyUtils;

// 复制文件内容
byte[] bytes = FileCopyUtils.copyToByteArray(new File("input.txt"));
FileCopyUtils.copy(bytes, new File("output.txt"));

// 读取文本
String content = FileCopyUtils.copyToString(
    new InputStreamReader(new FileInputStream("input.txt"), "UTF-8"));

// 流复制
FileCopyUtils.copy(inputStream, outputStream);
14. ResourceUtils
import org.springframework.util.ResourceUtils;

// 获取文件
File file = ResourceUtils.getFile("classpath:config.properties");

// 检查是否是URL
boolean isUrl = ResourceUtils.isUrl("http://example.com");

// 获取URL
URL url = ResourceUtils.getURL("classpath:data.json");
15. StreamUtils
import org.springframework.util.StreamUtils;

// 流操作
byte[] data = StreamUtils.copyToByteArray(inputStream);
String text = StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8);
StreamUtils.copy(inputStream, outputStream);
StreamUtils.copy("Hello", StandardCharsets.UTF_8, outputStream);
16. FileSystemUtils
import org.springframework.util.FileSystemUtils;

// 删除目录
boolean deleted = FileSystemUtils.deleteRecursively(new File("/tmp/test"));

// 复制目录
FileSystemUtils.copyRecursively(new File("source"), new File("target"));
17. ResourcePatternUtils
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.ResourcePatternUtils;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

// 获取匹配资源
Resource[] resources = ResourcePatternUtils.getResourcePatternResolver(
    new PathMatchingResourcePatternResolver())
    .getResources("classpath*:META-INF/*.xml");

Web相关工具类

18. WebUtils
import org.springframework.web.util.WebUtils;
import javax.servlet.http.HttpServletRequest;

// 获取Cookie
Cookie cookie = WebUtils.getCookie(request, "sessionId");

// 获取请求路径
String path = WebUtils.getLookupPathForRequest(request);

// 从请求中获取参数
int pageSize = WebUtils.getIntParameter(request, "pageSize", 10);
19. UriUtils
import org.springframework.web.util.UriUtils;

// 编解码URI组件
String encoded = UriUtils.encodePathSegment("path with spaces", "UTF-8");
String decoded = UriUtils.decode(encoded, "UTF-8");
20. UriComponentsBuilder
import org.springframework.web.util.UriComponentsBuilder;

// 构建URI
URI uri = UriComponentsBuilder.fromHttpUrl("http://example.com")
    .path("/products")
    .queryParam("category", "books")
    .queryParam("sort", "price")
    .build()
    .toUri();
21. ContentCachingRequestWrapper
import org.springframework.web.util.ContentCachingRequestWrapper;
import javax.servlet.http.HttpServletRequest;

ContentCachingRequestWrapper wrapper = new ContentCachingRequestWrapper(request);
// 请求处理后
byte[] body = wrapper.getContentAsByteArray();
22. HtmlUtils
import org.springframework.web.util.HtmlUtils;

// HTML转义
String escaped = HtmlUtils.htmlEscape("<script>alert('XSS')</script>");
// &lt;script&gt;alert('XSS')&lt;/script&gt;

// HTML反转义
String unescaped = HtmlUtils.htmlUnescape("&lt;b&gt;Bold&lt;/b&gt;");
// <b>Bold</b>

验证和断言工具

23. Assert
import org.springframework.util.Assert;

// 常用断言
Assert.notNull(object, "Object must not be null");
Assert.hasText(name, "Name must not be empty");
Assert.isTrue(amount > 0, "Amount must be positive");
Assert.notEmpty(items, "Items must not be empty");
Assert.state(isInitialized, "Service is not initialized");
24. ObjectUtils
import org.springframework.util.ObjectUtils;

// 对象工具
boolean isEmpty = ObjectUtils.isEmpty(null);  // true
boolean isEmpty2 = ObjectUtils.isEmpty(new String[0]);  // true

String nullSafe = ObjectUtils.nullSafeToString(null);  // "null"
boolean equals = ObjectUtils.nullSafeEquals(obj1, obj2);

// 默认值
String value = ObjectUtils.getOrDefault(null, "default");
25. NumberUtils
import org.springframework.util.NumberUtils;

// 数字转换
Integer parsed = NumberUtils.parseNumber("42", Integer.class);
Double converted = NumberUtils.convertNumberToTargetClass(42, Double.class);

日期和时间工具

26. DateTimeUtils
import java.util.Date;

// 格式化日期
String formatted = DateFormat.getDateTimeInstance().format(new Date());
27. StopWatch
import org.springframework.util.StopWatch;

// 计时工具
StopWatch watch = new StopWatch("TaskName");
watch.start("phase1");
// 执行任务1
Thread.sleep(100);
watch.stop();

watch.start("phase2");
// 执行任务2
Thread.sleep(200);
watch.stop();

// 输出报告
System.out.println(watch.prettyPrint());
System.out.println("Total time: " + watch.getTotalTimeMillis() + "ms");

安全相关工具

28. DigestUtils
import org.springframework.util.DigestUtils;

// MD5哈希
String md5 = DigestUtils.md5DigestAsHex("password".getBytes());

// 文件MD5
String fileMd5;
try (InputStream is = new FileInputStream("file.txt")) {
    fileMd5 = DigestUtils.md5DigestAsHex(is);
}
29. Base64Utils
import org.springframework.util.Base64Utils;

// Base64编解码
byte[] data = "Hello World".getBytes();
String encoded = Base64Utils.encodeToString(data);
byte[] decoded = Base64Utils.decodeFromString(encoded);
30. CryptoUtils
import org.springframework.security.crypto.encrypt.Encryptors;
import org.springframework.security.crypto.encrypt.TextEncryptor;

// 文本加密
String password = "secret";
String salt = "deadbeef";
TextEncryptor encryptor = Encryptors.text(password, salt);
String encrypted = encryptor.encrypt("Message");
String decrypted = encryptor.decrypt(encrypted);

JSON和数据转换工具

31. JsonUtils
import org.springframework.boot.json.JsonParser;
import org.springframework.boot.json.JsonParserFactory;

// JSON解析
JsonParser parser = JsonParserFactory.getJsonParser();
Map<String, Object> parsed = parser.parseMap("{"name":"John", "age":30}");
List<Object> parsedList = parser.parseList("[1, 2, 3]");
32. TypeUtils
import org.springframework.core.ResolvableType;

// 类型解析
ResolvableType type = ResolvableType.forClass(List.class);
ResolvableType elementType = type.getGeneric(0);

// 泛型类型处理
ResolvableType mapType = ResolvableType.forClassWithGenerics(
    Map.class, String.class, Integer.class);
33. MappingJackson2HttpMessageConverter
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import com.fasterxml.jackson.databind.ObjectMapper;

// 自定义JSON转换器
ObjectMapper mapper = new ObjectMapper();
// 配置mapper
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(mapper);

其他实用工具

34. RandomStringUtils
import org.apache.commons.lang3.RandomStringUtils;

// 随机字符串生成
String random = RandomStringUtils.randomAlphanumeric(10);
String randomLetters = RandomStringUtils.randomAlphabetic(8);
String randomNumeric = RandomStringUtils.randomNumeric(6);
35. CompletableFutureUtils
import java.util.concurrent.CompletableFuture;
import java.util.List;
import java.util.stream.Collectors;

// 合并多个CompletableFuture结果
List<CompletableFuture<String>> futures = /* 多个异步操作 */;
CompletableFuture<List<String>> allResults = CompletableFuture.allOf(
    futures.toArray(new CompletableFuture[0]))
    .thenApply(v -> futures.stream()
        .map(CompletableFuture::join)
        .collect(Collectors.toList()));
36. CacheControl
import org.springframework.http.CacheControl;
import java.util.concurrent.TimeUnit;

// 缓存控制
CacheControl cacheControl = CacheControl.maxAge(1, TimeUnit.HOURS)
    .noTransform()
    .mustRevalidate();

String headerValue = cacheControl.getHeaderValue();
37. AnnotationUtils
import org.springframework.core.annotation.AnnotationUtils;

// 查找注解
Component annotation = AnnotationUtils.findAnnotation(MyClass.class, Component.class);

// 获取注解属性
String value = AnnotationUtils.getValue(annotation, "value").toString();

// 合并注解
Component mergedAnnotation = AnnotationUtils.synthesizeAnnotation(
    annotation, MyClass.class);
38. DefaultConversionService
import org.springframework.core.convert.support.DefaultConversionService;

// 类型转换
DefaultConversionService conversionService = new DefaultConversionService();
String strValue = "42";
Integer intValue = conversionService.convert(strValue, Integer.class);
39. HeaderUtils
import org.springframework.http.HttpHeaders;

// HTTP头处理
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
headers.setContentLength(1024);
headers.setCacheControl("max-age=3600");
40. MediaTypeFactory
import org.springframework.http.MediaType;
import org.springframework.http.MediaTypeFactory;
import java.util.Optional;

// 根据文件名推断媒体类型
Optional<MediaType> mediaType = MediaTypeFactory.getMediaType("document.pdf");
// application/pdf
41. MimeTypeUtils
import org.springframework.util.MimeTypeUtils;

// MIME类型常量和解析
boolean isCompatible = MimeTypeUtils.APPLICATION_JSON.isCompatibleWith(
    MimeTypeUtils.APPLICATION_JSON_UTF8);
42. WebClientUtils
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;

// 创建WebClient
WebClient webClient = WebClient.builder()
    .baseUrl("https://api.example.com")
    .defaultHeader("Authorization", "Bearer token")
    .filter(ExchangeFilterFunction.ofRequestProcessor(
        clientRequest -> {
            // 请求处理
            return Mono.just(clientRequest);
        }))
    .build();
43. PropertySourceUtils
import org.springframework.core.env.PropertySource;
import org.springframework.core.env.StandardEnvironment;

// 添加属性源
StandardEnvironment env = new StandardEnvironment();
Map<String, Object> map = new HashMap<>();
map.put("app.name", "MyApp");
env.getPropertySources().addFirst(new MapPropertySource("my-properties", map));
44. EventPublishingUtils
import org.springframework.context.ApplicationEventPublisher;

// 发布事件
ApplicationEventPublisher publisher = /* 获取发布器 */;
publisher.publishEvent(new CustomEvent("Something happened"));
45. LocaleContextHolder
import org.springframework.context.i18n.LocaleContextHolder;
import java.util.Locale;

// 获取/设置当前语言环境
Locale currentLocale = LocaleContextHolder.getLocale();
LocaleContextHolder.setLocale(Locale.FRENCH);
46. AopUtils
import org.springframework.aop.support.AopUtils;

// AOP工具方法
boolean isAopProxy = AopUtils.isAopProxy(bean);
boolean isCglibProxy = AopUtils.isCglibProxy(bean);
Class<?> targetClass = AopUtils.getTargetClass(bean);
47. ProxyUtils
import org.springframework.aop.framework.ProxyFactory;

// 创建代理
ProxyFactory factory = new ProxyFactory(targetObject);
factory.addInterface(MyInterface.class);
factory.addAdvice(new MyMethodInterceptor());
MyInterface proxy = (MyInterface) factory.getProxy();
48. ClassPathScanningCandidateComponentProvider
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;

// 扫描类路径
ClassPathScanningCandidateComponentProvider scanner = 
    new ClassPathScanningCandidateComponentProvider(true);
scanner.addIncludeFilter(new AnnotationTypeFilter(Component.class));
Set<BeanDefinition> beans = scanner.findCandidateComponents("org.example");
49. YamlUtils
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.core.io.ClassPathResource;

// 解析YAML文件
YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
yaml.setResources(new ClassPathResource("application.yml"));
Properties properties = yaml.getObject();

总结

这些工具类涵盖了Java开发中的大部分常见场景,从基础的字符串处理到高级的反射操作,从文件IO到安全加密,从Web开发到性能监控。

熟练掌握这些工具类可以显著提高开发效率,减少样板代码,并帮助编写更健壮的应用程序。

在日常开发中,建议养成查看Spring和SpringBoot文档的习惯,挖掘更多有用的工具类。


欢迎加入我的知识星球,全面提升技术能力。

👉 加入方式,“长按”或“扫描”下方二维码噢:

星球的内容包括:项目实战、面试招聘、源码解析、学习路线。

文章有帮助的话,在看,转发吧。
谢谢支持哟 (*^__^*)
SpringBoot第49讲:SpringBoot定时任务 - 基础quartz实现方式 除了SpringTask,最为常用的Quartz,并且Spring也集成了Quartz的框架。本文是SpringBoot第49讲,主要介绍Quartz和基础的Quartz的集成案例。 阅读详情

相关推荐

【SpringBoot】49、SpringBoot中手动抛出异常回滚事务

我们通常在项目中都是使用全局事务配置,这样我们就不必在每个业务类的方法上加 @Transactional 注解,只要代码抛出异常,就会自动回滚事务 但是我们有的时候需要事务回滚并不一定是代码发生了异常,而是我们对业务逻辑的判断需要回滚事务,这时候,我们需要手动抛出运行时异常,例如: /** * before */ if (null == obj) { // 手动抛异常 throw new RuntimeException("对象为空,不能继续进行"); } /** * after *

JACKAL 20万+

springboot重点记载

1、yaml 配置文件 SpringBoot使用一个全局的配置文件,配置文件名称是固定的 application.properties 语法结构:key=value application.yaml 语法结构:key: 空格value 配置文件的作用:修改spring自动配置的默认值。 配置文件与配置类直接通过@ConfigurationProperties的属性prefix来进行绑定 @ConfigurationProperties作用: 将配置文件中配置的每一个属性的值,映射到这个组件

小匠的Blog 330

ROS下UR+Realsense相机进行手眼标定

手眼标定主要是用来确定相机坐标系和机械臂坐标系之间的转换关系,从而实现后续的抓取等任务。

weixin_42157689的博客 7578

Spring Boot配置常量类

1.先引入maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> &lt

程序员咏哥的博客 3117

如何从RHEL 8升级到RHEL 9

Red Hat 于 2022 年 5 月 17 日宣布全面推出 RHEL 9。这是 RHEL(Red Hat Enterprise Linux)的最新版本,它具有许多功能和增强功能。

u012748257的博客 1020

别再到处找离线包了!Visual Studio 2022 企业版/社区版离线安装保姆级教程(含工作负载选择指南)

本文提供Visual Studio 2022企业版/社区版离线安装的详细教程,包括工作负载选择指南和批量安装优化策略。针对网络隔离或带宽受限环境,介绍如何制作离线安装包、选择合适的工作负载组合,并分享高级技巧如增量更新和自动化部署,帮助团队高效统一开发环境配置。

weixin_28745821的博客 737

SpringBoot开发必备!49个内置工具类,让你的代码效率翻倍!

SpringBoot内置49个高效工具类,助开发者快速解决常见开发痛点。包含字符串处理(StringUtils、AntPathMatcher)、文件操作(FileCopyUtils)、集合处理(MultiValueMap)、反射工具(ReflectionUtils)、Web开发(UriComponentsBuilder)、安全验证(DigestUtils、Assert)等核心场景解决方案,并提供了StopWatch性能监控工具。这些工具类封装在spring-core等基础包中,无需额外依赖,推荐优先使用Sp

Primary_wind的专栏 432

【SABRE 3D, SABRE 3DxT,LAM设备】2025年9月13日-安全配置-准备工作

请遵循本规程将SABRE 3D/3DxT/3D Scimitar系统设置为安全配置,以便能够在电镀单元、APT模块、XMM(或SRD)模块、工厂接口(FI)外壳或中央通道内部及周边区域执行作业p104-p117。在生产过程中暂停调度程序存在一定风险:若待维护模块未离线且在其他模块完成处理前重启调度程序,可能对生产晶圆造成影响。维护人员需特别注意电镀模块内的晶圆状态,并尽可能快速地恢复调度程序。确认待维护模块内无晶圆滞留暂停调度程序并将相应模块设置为离线状态打开模块检修门并关闭安全盖板(槽位)

weixin_46735260的博客 1370

如何快速部署Blog49博客系统?Docker一站式解决方案详解

Blog49是一款基于Vue和SpringBoot的前后端分离博客系统,通过Docker容器化部署可以极大简化安装流程,让新手也能在几分钟内完成博客平台的搭建。本文将详细介绍使用Docker一站式部署Blog49的完整步骤,帮助你快速拥有属于自己的专业博客系统。 ## 📋 准备工作:部署环境要求 在开始部署前,请确保你的服务器满足以下基本条件: - 操作系统:Linux(推荐Ubuntu 2

gitblog_00894的博客 1112

计组实验4 控制冒险与分支预测

目录前言实验内容背景知识分支预测技术⭐阻塞周期计算方法不开启 BTB开启 BTBpart 1 矩阵乘法与优化未开启 BTB 的分析开启 BTB 的分析part 2 设计代码使 BTB 无效part 3 循环展开优化矩阵乘法未开启 BTB开启 BTB结束语结论 前言 上一篇博客:计组实验3 mips冒险之流水线冒险 摸了半个月了。。。咕咕咕 今天来写计组实验 4 这个实验非常简单,就是有点难。 这个实验比较容易算错,或者是被模拟器出人意料的结果搞的神神叨叨的,所以今天来记录并且详细分析该实验。 注:请务必阅

AKGWSB 's blog 5669

【影像组学】用3Dslicer或Python提取影像组学特征

用3Dslicer或Python提取影像组学特征

abdslfwoeugp 1万+

终极指南:从零搭建前后端分离博客平台Blog49——Vue+SpringBoot完整实践

Blog49是一个基于Vue和SpringBoot的前后端分离博客平台,专为开发者打造。本指南将带你快速掌握从环境搭建到功能实现的全过程,让你轻松拥有自己的专业博客系统。无论你是编程新手还是有经验的开发者,都能通过本教程快速上手这个强大的博客解决方案。 ## 📋 为什么选择Blog49?核心优势解析 Blog49采用现代Web开发架构,结合了Vue的前端灵活高效与SpringBoot的后端稳

gitblog_00896的博客 933

基于FPGA的FIR数字滤波器设计

clear;close all fc=1/4;fs=5/16; %输入给定指标 Rp=3;As=60;Fs=2; f=[fc,fs];m=[1,0]; %计算remezord函数所需参数f,m,dev dev=[(10^(Rp/20)-1)/(10^(Rp/20)+1),10^(-As/20)]; [N,fo,mo,W]=remezord(f,m,dev,Fs); %确定remez函数所需参数 hn=remez(N,fo,mo,W);...

FPGA/MATLAB学习教程/源码/项目合作开发 9455

SpringBoot+Redis缓存策略:提升Blog49博客性能的5个关键技巧

在现代Web应用开发中,缓存是提升系统性能的关键技术之一。对于Blog49这样的前后端分离博客系统(基于Vue+SpringBoot架构),合理的缓存策略能够显著减少数据库压力、加快页面加载速度并提升用户体验。本文将分享5个实用的SpringBoot+Redis缓存技巧,帮助开发者优化博客系统性能。 ## 1. 核心缓存配置:奠定高性能基础 Blog49项目的缓存核心配置集中在`RedisCo

gitblog_00785的博客 1042

Openai gym environment for multi-agent games

用于多智能体游戏的 OpenAI Gym 环境

suiusoar 1197

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

SpringBoot切换内置web服务器

SpringBoot内置web服务器切换 SpringBoot的web环境中默认使用tomcat作为内置服务器,其实SpringBoot提供了4中内置服务器供我们选择,我们可以很方便的进行切换。 依赖包下面org.springframework.boot:spring-boot-autoconfigure中下面的web可看到SpringBoot提供了4中内置服务器 内置服务器切换可通过在pom.xml文件中进行操作如如下所示由Tomcat切换到Jetty: <dependency> &

qingbo_2920249511的博客 489

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Blog49核心功能全解析:用户认证、博文管理与实时评论系统实战

Blog49是一个基于Vue+SpringBoot的前后端分离博客系统,提供完整的用户认证、博文管理和实时评论功能。本指南将带你快速掌握这个强大博客系统的核心功能与使用方法,帮助你从零开始搭建自己的技术博客平台。 ## 一、安全可靠的用户认证系统 用户认证是博客系统的基础,Blog49采用JWT(JSON Web Token)实现无状态身份验证,结合Spring Security提供全面的安全

gitblog_01190的博客 1118

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

springboot使用内置tomcat启动时关于APR版本问题的报错

SpringBoot内置tomcat出现error:An incompatible version [1.1.32] of the APR based Apache Tomcat Native library is installed, while Tomcat requires versi...

zipp的博客 1564

SpringBoot(49) —— 邮件任务

目录1.环境搭建2.简单邮件发送3.复杂邮件发送4.将邮件发送抽象成一个可以复用的工具方法 1.环境搭建 导入依赖<!--邮件发送依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> 可见,我们直接使用的是s

Jzandth的博客 981

Camunda 7.18 SpringBoot 集成实战:3种API调用方式与49张表结构解析

本文详细介绍了Camunda 7.18与SpringBoot的三种集成模式,包括Java原生API调用、REST API集成和Web控制台嵌入,并深入解析了Camunda自动生成的49张数据库表的设计哲学。通过实战示例和配置建议,帮助开发者高效集成流程引擎,优化企业级应用的工作流管理。

weixin_33700350的博客 419

Springboot2(49)集成sentinel

源码地址 springboot2教程系列 启动Sentinel控制台 下载 下载最新版的控制台sentinel-dashboard-1.6.1.jar,下载地址 本地启动 java -Dserver.port=8080 -jar sentinel-dashboard.jar 本地访问sentinel控制台 http://10.10.2.139:8080,用户和密码都是sentinel 方法一:...

cowbin2012的专栏 1万+

genshin-wish-export:三步拿走全部原神祈愿记录,附避坑清单

genshin-wish-export 是一款原神祈愿记录导出工具:你在游戏里打开一次祈愿历史页面,它就替你取回全部祈愿记录,最终落成一张 Excel 表格或一份社区通用的 UIGF JSON 文件。多账号玩家想把抽卡历史留下来、想把数据喂给第三方分析站的人,正是它的使用者。 ## 它解决什么问题 先说几个很真实的场景: - 祈愿历史只能在游戏里看,换了设备、退了号,之前的记录就彻底翻不到了

gitblog_00772的博客 857

day49-Springboot

1.1简介:Springboot来简化Spring应用开发的一个框架,约定大于配置1.2优点:可以快速的构建独立运行的Spring项目;框架内有Servlet容器,无需依赖外部,所以不需要达成war包(自带Tomcat,无需部署,与Servlet高度集成);极力去掉重复恶心的xml配置(优化xml,精简)1.3目录结构:resource目录下static:保存所有静态资源js,css,images;templates:保存所有的模版页面(默认不支持jsp);

weixin_63713552的博客 440

MongoDB与MySQL双数据库设计:Blog49数据存储方案揭秘

在现代Web开发中,选择合适的数据存储方案对系统性能和可扩展性至关重要。Blog49作为一个前后端分离的博客系统(vue+springboot),创新性地采用了MongoDB与MySQL双数据库架构,为博客类应用提供了高效且灵活的数据管理解决方案。本文将深入剖析这一混合存储模式的设计思路、实现方式及实际应用效果,帮助开发者理解如何在项目中合理搭配关系型与非关系型数据库。 ## 双数据库架构的核心

gitblog_00685的博客 340
上一篇: 为什么淘宝订单号后6位始终一样?
下一篇: Redis官方发布高颜值可视化工具,功能更是强的离谱!
公众号-芋道源码
博客等级 码龄10年 1638粉丝 377原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值