会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
加瓦儿
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
13
下一页
2024年7月6日
pom里定义额外的私服
摘要: <repositories> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/milestone</url> <snapshots> <enabled
阅读全文
posted @ 2024-07-06 09:01 漠孤烟
阅读(17)
评论(0)
推荐(0)
2024年7月4日
在构造方法里获取当前类的泛型
摘要: 定义 public class MyClass<T> { private Class<T> clazz; public MyClass() { Type type = this.getClass().getGenericSuperclass(); if (type instanceof Parame
阅读全文
posted @ 2024-07-04 14:38 漠孤烟
阅读(26)
评论(0)
推荐(0)
将一个带有main方法的jar生成为可执行jar
摘要: 默认情况下,打出来的jar包都是给其他项目依赖的。如果本身该jar要独立运行,则需要打包成executable jar jar --create --file App.jar --main-class com.example.App -C build . App.jar: jar包名 com.exa
阅读全文
posted @ 2024-07-04 09:09 漠孤烟
阅读(42)
评论(0)
推荐(0)
2024年7月2日
使用jakarta.json进行json序列化和反序列化
摘要: 引言 java里,json框架何其多,常见的有jackson、fastjson、gson等。各自的api互不相通,与代码耦合度高,切换json库的代码修改工作量非常大。如果使用json的api为统一的入口,各家再进行实现,代码与实现类不耦合,像slf4j一样,切换log框架(log4j/logbac
阅读全文
posted @ 2024-07-02 11:19 漠孤烟
阅读(686)
评论(0)
推荐(0)
2024年6月19日
axios全局加header、request、response拦截
摘要: 1、包装axios const restWithHeader = axios.create({ baseURL: import.meta.env.APP_BASE_API_URL, timeout: 60000, headers: { 'header1': 'This is a header val
阅读全文
posted @ 2024-06-19 08:51 漠孤烟
阅读(251)
评论(0)
推荐(0)
2024年6月17日
Linux开启端口
摘要: #查看想开的端口是否已开: firewall-cmd --query-port=3306/tcp #添加指定需要开放的端口: firewall-cmd --add-port=3306/tcp --permanent #重载入添加的端口: firewall-cmd --reload #查询3306端口
阅读全文
posted @ 2024-06-17 10:57 漠孤烟
阅读(22)
评论(0)
推荐(0)
2024年6月14日
使用Java实现nginx反向代理的功能
摘要: 需求 访问某个url后缀时,例如:/abc/*,自动路由到指定http服务地址http://myhost/* 代码 httpServer.createContext("/abc", BeanFactory.proxyHandler("yourhost:8080")); 反向代理处理器 public
阅读全文
posted @ 2024-06-14 14:43 漠孤烟
阅读(416)
评论(0)
推荐(0)
2024年6月12日
检查字符串是什么编码字符集
摘要: 引入依赖 <dependency> <groupId>com.googlecode.juniversalchardet</groupId> <artifactId>juniversalchardet</artifactId> <version>1.0.3</version> </dependency
阅读全文
posted @ 2024-06-12 15:30 漠孤烟
阅读(29)
评论(0)
推荐(0)
2024年6月6日
使用CRaC机制为Java应用创建checkpoint
摘要: CRaC Coordinated Restore at Checkpoint,翻译为中文:从检查点原样恢复重启。 大致的原理是将JVM的当前运行状态进行持久化存储起来,相当于存储某一刻运行时的快照,给那一刻的JVM运行状态进行拍照即为检查点。再启动服务时直接通过该快照文件恢复至运行状态。通过检查点恢
阅读全文
posted @ 2024-06-06 11:16 漠孤烟
阅读(377)
评论(0)
推荐(0)
2024年6月5日
Spring Boot开启AOT的方式运行
摘要: Spring Boot支持对AOT模式的启动、测试 1、构建 mvn -Pnative native:compile 或 mvn -Pnative spring-boot:build-image 1、启用AOT的方式启动app java -Dspring.aot.enabled=true -jar
阅读全文
posted @ 2024-06-05 15:50 漠孤烟
阅读(873)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
13
下一页
公告