文章分类 -  Java

摘要:1. Cache-Control response.setHeader("Cache-Control", "max-age=5");// 缓存是5秒 2. 实例 2.1 前端 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>In 阅读全文
posted @ 2023-04-27 21:40 君子键 阅读(134) 评论(0) 推荐(0) 编辑
摘要:依赖 <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.13</version> </dependency> <dependency> <groupId>net.co 阅读全文
posted @ 2023-03-26 15:21 君子键 阅读(409) 评论(0) 推荐(0) 编辑
摘要:创建数据源 执行 C:\Windows\System32\odbcad32.exe 参考:https://www.cnblogs.com/BelieveFish/p/10275320.html 添加 jdbc.jar 参考:https://blog.csdn.net/qq_42839596/arti 阅读全文
posted @ 2023-03-16 20:45 君子键 阅读(264) 评论(0) 推荐(0) 编辑
摘要:@Component public class AccessUtils { public static boolean DEBUG;// 是否开启调试 public static String ACCESS_DB_NAME;// access数据源名称 public static String AC 阅读全文
posted @ 2023-03-16 20:39 君子键 阅读(131) 评论(0) 推荐(0) 编辑
摘要:发生场景:代码编译没有问题,但在 eclipse 中和打包后在 tomcat 中启动失败,出现异常 java.io.IOException: invalid constant type: 18 原因:采用了Lambda 表达式(如:new Thread(() -> {}).start();),而且 阅读全文
posted @ 2023-03-15 20:13 君子键 阅读(961) 评论(1) 推荐(0) 编辑
摘要:实体类(例子) package com.boeetech.lims.testing.abutment; import lombok.Data; /** * 上传文件数据传输对象 * @author boeetech * */ @Data public class UploadFileDTO { pr 阅读全文
posted @ 2023-03-12 15:11 君子键 阅读(638) 评论(0) 推荐(0) 编辑
摘要:文件转成字节数组 /** * 文件转换成字节数组 * @param path 文件路径 * @return 字节数组 */ public static byte[] fileToBytes(String path) { InputStream is = null; try { is = new Fi 阅读全文
posted @ 2023-02-16 10:18 君子键 阅读(195) 评论(0) 推荐(0) 编辑
摘要:问题:用 poi 生成的 excel 打印时会分页,实际上内容是一页打印的下的,可以通过设置页边距来调整,使其一页打印下。 代码(以下是将旧的 sheet 页的页边距复制到新 sheet 页的代码,可作为参考): /** * 复制页边距 * @param newSheet 新 sheet * @pa 阅读全文
posted @ 2023-02-14 08:53 君子键 阅读(623) 评论(0) 推荐(0) 编辑
摘要:@Test public void testBigDecimal() { BigDecimal bd = new BigDecimal("0.00000000000001000000"); System.out.println("默认使用科学计数法:" + bd); System.out.print 阅读全文
posted @ 2022-05-10 08:48 君子键 阅读(2757) 评论(0) 推荐(1) 编辑
摘要:在 application.yml 中增加或修改配置 server.max-http-header-size,默认是 8KB # 服务器配置 server: max-http-header-size: 1024KB 阅读全文
posted @ 2022-02-10 19:16 君子键 阅读(54) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示