![](https://img-blog.csdnimg.cn/20190927151053287.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
java
java
完美明天cxp
这个作者很懒,什么都没留下…
展开
-
Java计算md5值不是32位
1.背景做文件分片上传时,在合并文件片段时校验文件md5值时和前端不一致2.源代码MessageDigest md5 = MessageDigest.getInstance("MD5");FileInputStream fis = new FileInputStream(new File(file));int len;byte[] buf = new byte[8 * 1024 * 1024];while ((len = fis.read(buf)) != -1) { md5.原创 2022-05-05 20:03:20 · 768 阅读 · 0 评论 -
JVMTI实现SpringBoot的jar加密,防止反编译
JVMTI实现SpringBoot的jar加密,防止反编译原创 2022-02-21 16:19:58 · 5319 阅读 · 0 评论 -
mybatis-plus代码生成器
mybatis-plus代码生成原创 2021-12-08 10:54:05 · 1100 阅读 · 0 评论 -
java使用lambda表达式多条件排序
一、使用java的lambda表达式多条件排序,这里多条件是指同时生效先把我的对象摆上@Data@AllArgsConstructor@ToStringpublic class Student { private String name; private String age; private Integer id; private Integer score;}然后再准备好排序的数据List<Student> studentList = new原创 2020-06-09 20:15:48 · 9436 阅读 · 2 评论 -
注解实现接口幂等防重
一、需求为了解决重复提交造成数据冗余出现误差,防止前端提交过快造成服务器不必要的压力过大二、源码解析采用技术spring AOP、反射动态代理、spring EL表达式、redis同步锁、java自定义注解1.注解@Documented@Target({ElementType.METHOD})@Retention(RetentionPolicy.RUNTIME)public @interface NoReSubmit { /** * 限制接口再次提交时间(秒)原创 2020-05-19 11:53:42 · 910 阅读 · 0 评论 -
Spring启动报错:java.lang.ClassNotFoundException: org.springframework.expression.ParserContext
1.记录一次启动报错:Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/expression/ParserContext at org.springframework.context.support.AbstractApplicationContext.prepareBeanFactor...原创 2019-11-18 14:27:58 · 2250 阅读 · 0 评论 -
IDEA中:源值/目标值1.5已过时,将在未来所有版本中删除
1.由于IDEA中默认把项目设为jdk1.5版本,所以我们在启动项目时就会出现如题目的警告。2.解决办法:(1)修改maven的settings.xml文件,添加如下配置: <id>jdk8</id> <activation> <activeByDefault>true</activeByDefault> <...原创 2019-07-05 16:41:34 · 1590 阅读 · 0 评论 -
IDEA中Lombok使用
1.Lombok介绍官网介绍:Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java.Never write another getter or equals method again, with one annotation...原创 2019-07-09 09:56:32 · 182 阅读 · 0 评论 -
JNA/JNI和C/C++的数据类型转换
官方文档原创 2019-03-04 11:43:44 · 1151 阅读 · 0 评论 -
以Java的视角来聊聊BIO、NIO与AIO的区别
https://baijiahao.baidu.com/s?id=1573998393898438&amp;wfr=spider&amp;for=pc转载 2019-01-09 10:48:38 · 101 阅读 · 0 评论 -
java使用jna调用dll
1.先放代码c++生成dll代码:// Testdll.cpp : 定义 DLL 应用程序的导出函数。//#include "stdafx.h"extern "C" __declspec(dllexport) int add(int a, int b);int add(int a, int b) { return a + b;}java代码:import com.sun.j...原创 2018-12-17 11:28:09 · 227 阅读 · 0 评论 -
mybatis找不到mapper映射文件
mybatis默认找的映射文件路径是src/main/resources,如果放在src/main/java下的一个包中,则需要在该项目的pom.xml文件中加入:&amp;lt;build&amp;gt; &amp;lt;resources&amp;gt; &amp;lt;resource&amp;gt; &amp;lt;directory&amp;gt;s原创 2018-10-21 17:42:16 · 2674 阅读 · 1 评论