随笔分类 - 00-Java
摘要:URL编码 https://www.iamwawa.cn/urldecode.html 空格 %20 或 + :冒号 %3A /斜杠 %2F RFC3986 协议对 URL 的编解码问题做出了详细的建议,指出了哪些字符需要被编码才不会引起 URL 语义的转变,以及对为什么这些字符需要编码做出了相应的
阅读全文
摘要:String.format 1、字符串左对齐,不足10位的右侧补空格:[123 ] String.format("%-10s", "123"); 2、字符串右对齐,不足10位的左侧补空格:[ 123] String.format("%10s", "123"); 3、整数格式化10位,不足左侧补0:[
阅读全文
摘要:【Java Web】行锁for update begin; select * from system_role where id_ = '1626887644786495491' for update; update system_role set version_ = 0 where id_ =
阅读全文
摘要:接口接收文件@RequestParam("file") MultipartFile file MultipartFile转byte[] String name = file.getName(); String originalFilename = file.getOriginalFilename()
阅读全文
摘要:https://www.cnblogs.com/cndarren/p/15982972.html 由于是spring-web-5.2.15.RELEASE版本中出现了此问题,查看了Spring官网的版本信息,发现在spring-web-5.2.16.RELEASE版本中,针对此问题进行了修复 <de
阅读全文
摘要:https://www.dandelioncloud.cn/article/details/1512394964310007809 https://blog.csdn.net/zlsuperjj/article/details/92439816 【单点登录SSO】服务端 下载地址:https://g
阅读全文
摘要:【Java Web】@Aspect 注意:服务调用的方法才会走切面,this调用的不会走切面,原因是服务对象是spring注入的代理对象和this不是同一东西。 切点 @Pointcut(value=“execution(* ycx.UserService.*(…))”) 表达式 execution
阅读全文
摘要:【JaveSE】MD5加密 1、apache commons-codec.jar,一般工程,不引入spring的情况 import org.apache.commons.codec.digest.DigestUtils; /** * MD5加密之方法一 * @explain 借助apache工具类D
阅读全文
摘要:https://blog.csdn.net/qq_44749491/article/details/130123065 中国一共分了5个时区 哈尔滨 Asia/Harbin 长白时区GMT+8:30上海 Asia/Shanghai 标准时区 GMT+8重庆 Asia/Chongqing 陇蜀时区GM
阅读全文
摘要:@Configuration和@EnableConfigurationProperties和@AutoConfigureBefore和@AutoConfigureAfter
阅读全文
摘要:【Java Web】条件Bean@ConditionalOnResource 注解仅仅会加载classpath中指定的资源,资源存在则创建对象,资源不存在则不创建对象。外部资源文件无法加载,想要使用外部资源文件参考: resources目录下资源application.properties,存在则创
阅读全文
摘要:https://chenyongjun.vip/articles/77 java -Djavax.net.debug=all -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" -Dhttps.protocols="TLSv1,TLSv1.1,TLS
阅读全文
摘要:@ConditionalOnProperty 根据属性值创建对象 属性存在且值匹配时创建,不存在时不创建。my-config.enable-property = true时才会创建对象 my-config.enable-property = true import org.springframewo
阅读全文
摘要:java @Value("${encryptEnable:false}") boolean encryptEnable; 配置中心 encryptEnable java @RefreshScope //修复自动刷新 @ConfigurationProperties(prefix = "encrypt
阅读全文
摘要:【Java SE】http请求HttpClient 文档:https://hc.apache.org/httpcomponents-client-4.5.x/current/tutorial/html/fundamentals.html 依赖 <dependency> <groupId>org.ap
阅读全文
摘要:【Java SE】http请求RestTemplate RestTemplate对象 @Configuration public class RestTemplateConfiguration { @Bean public RestTemplate restTemplate() { HttpComp
阅读全文
摘要:返回自己和超类的 public 字段、方法、构造器getFields()getMethods()getConstructors() 超类没返回 返回自己的所有 字段、方法、构造器getDeclaredFields()getDeclaredMethods()getDeclaredConstructor
阅读全文
摘要:代理会在运行时创建一个实现了一组给定接口的新类。创建的代理类名字以$Proxy开头,并且是public和final的。创建代理类时需要提供一个实现了InvocationHandler接口的调用处理器,无论何时调用代理对象的方法,调用处理器的invoke方法都会被调用,并向其传递Method和原始对象
阅读全文