• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
牛牛
牛牛在线
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页

2023年7月20日

springboot i18n 国际化
摘要: 默认一: 1、配置 # 主Spring spring: messages: basename: i18n.rsltMessage,i18n.errorCodeMessage 2、多语言文件 在resources下 新建i18n文件夹 ,在在这个下面建立多语言: rsltMessage.propert 阅读全文
posted @ 2023-07-20 17:38 蜗牛无敌 阅读(171) 评论(0) 推荐(0)
 
 

2023年7月18日

springboot 全局异常处理类
摘要: 1、全局异常处理 import lombok.extern.slf4j.Slf4j; import org.slf4j.helpers.MessageFormatter; import org.springframework.beans.factory.annotation.Autowired; i 阅读全文
posted @ 2023-07-18 10:25 蜗牛无敌 阅读(62) 评论(0) 推荐(0)
 
 

2023年7月14日

springboot 使用caffeine 并监控本地缓存
摘要: 1、添加依赖 <dependency> <groupId>com.github.ben-manes.caffeine</groupId> <artifactId>caffeine</artifactId> </dependency> 2、添加配置 package com.example.demo.c 阅读全文
posted @ 2023-07-14 17:57 蜗牛无敌 阅读(1061) 评论(0) 推荐(0)
 
springboot log4j2.xml 模板
摘要: <?xml version="1.0" encoding="utf-8"?> <configuration> <properties> <!-- 文件输出格式 --> <property name="PATTERN">%d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [% 阅读全文
posted @ 2023-07-14 16:31 蜗牛无敌 阅读(193) 评论(0) 推荐(0)
 
 

2023年7月12日

springboot 自定义整合caffeine 本地缓存
摘要: 1、自定义缓存配置类 @Data @ConfigurationProperties(prefix = "page.cache") public class PageCacheProperties { private CaffeineConfigProperties caffeine = new Ca 阅读全文
posted @ 2023-07-12 14:03 蜗牛无敌 阅读(517) 评论(0) 推荐(0)
 
 

2023年7月11日

springboot 自定义参数转换器,把自定义字符串 转换成响应的对象
摘要: 1、定义参数转换器 并放入ios容器中 package com.example.demo.convert; import com.example.demo.domain.Phone; import org.springframework.core.convert.converter.Converte 阅读全文
posted @ 2023-07-11 09:26 蜗牛无敌 阅读(368) 评论(0) 推荐(0)
 
 

2023年7月10日

springboot 使用filter 增加全局 traceId,方便日志查找
摘要: 1、编写过滤器 package com.example.demo.filter; import org.slf4j.MDC; import org.springframework.util.StringUtils; import javax.servlet.*; import javax.servl 阅读全文
posted @ 2023-07-10 10:44 蜗牛无敌 阅读(654) 评论(0) 推荐(0)
 
 

2023年7月7日

java自定义注解,aop处理
摘要: 1、定义注解 package com.example.demo.anno; import java.lang.annotation.*; @Target({ ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) @Documented p 阅读全文
posted @ 2023-07-07 15:05 蜗牛无敌 阅读(165) 评论(0) 推荐(0)
 
 

2023年7月5日

springboot 加载自定义的属性配置文件 或者xml文件
摘要: 1、properties user.properties name=zhangshan age=18 2、xml Pen1.xml <?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE properties SYSTEM "http://java.sun 阅读全文
posted @ 2023-07-05 16:42 蜗牛无敌 阅读(523) 评论(0) 推荐(0)
 
 

2023年6月13日

json字符串解析 多语言替换
摘要: import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframe 阅读全文
posted @ 2023-06-13 21:22 蜗牛无敌 阅读(76) 评论(0) 推荐(0)
 
 
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页

公告


博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3