-
-
命名的重要性 无论技术水平怎么样、编程思想有没有,即使写个helloworld也要先把名字想好,这是对自己、队友以及后来人的尊重,也是一个程序员最基本的道德之一。 如果你的英文实在不行,字典都不会查,用中文也可以,但至少要保证别人能看明白,名字都不好好写的混子,应该尽早滚出IT界
-
浏览器输入192.168.1.10:10 192.168.1.10的nginx转发给192.168.1.20:82 192.168.1.20的nginx转发给192.168.1.80:8080 192.168.1.80启动tomcat监听8080端口 request.getServerPort(
-
@echo off start javaw -jar jar包名称.jar exit @echo off taskkill /f /im javaw.exe exit 0
-
Java读取HTTPS/SSL证书异常
-
IDEA测试时run可以执行,debug执行不了 有可能是由于JDK版本太低了,导致debug执行不了,换个高版本测试一下看看
-
wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz tar -zxvf jdk-21_linux-x64_bin.tar.gz 创建jdk安装目录 mkdir /usr/local/j
-
PDF格式比较简单直接读取文本内容,正则抽取发票号码 剪切板中的截图先上传base64到服务器也是转换成图片格式 解析图片中的二维码,如果解析二维码失败,则截取图处一部分,再解析直到解析成功或小到一定尺寸 【POM参考示例源码】 public static String decode(File fi
-
如所有包含org.anyline的目录,有可能是在jar中 Enumeration<URL> urls = ConfigTable.class.getClassLoader().getResources("org/anyline/"); while (urls.hasMoreElem
-
getResource("/")返回项目classes目录,返回protocol=file getResource("")返回当前类所在的目录,有可能是jar内部目录如 file:/D:/jar/maven/org/anyline/anyline-core/8.7.2-SNAPSHOT/anylin
-
java.util.logging.Logger.getLogger("org.apache.http.wire").setLevel(java.util.logging.Level.OFF); logback的日志级别 ch.qos.logback.classic.LoggerContext l
-
平时我们用println会每个进度输出一行,输出类似这样的效果 1/100 2/100 3/100 而理想效果是后一个进度把前一个进度覆盖。只在这一行输出,当输出2/100时,把原来的1/100清除掉 System.out.print("1/100") //注意这里不要换行 System.out.p
-
Entity entity = new Entity(); //implements Serializable 非transient属性 //写入文件 File file = new File("serial.txt"); ObjectOutputStream out = new ObjectOut
-
使用unzip解压zip格式文件时,解压不成功,并给出其错误提示为: Archive: *.zip End-of-central-directory signature not found. Either this file is not
-
File > Settings > Build,Execution,Deployment > 选中Build project automatically <dependency> <groupId>org.springframework.boo
-
办法一: <Server port="8002" shutdown="SHUTDOWN" > <Service name="Catalina"> <Connector port="81
-
mongodb更新比较快,spring有点跟不上,直接参考官网,当前版本6.0.8 https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/connection/connect/#std-label-connect-to
-
logback配置文件加载顺序
1.首先会试着查找logback.groovy文件;
2.当没有找到时,继续试着查找logback-test.xml文件;
3.当没有找到时,继续试着查找logback.xml文件;
4.如果仍然没有找到,则使用默认配置(打印到控制台)。
Spring Boot官方推荐优先使用带有logback-spring.xml的日志配置文件,spring bo
-
不同版本的tomcat参数略有区别
8.0参考http://tomcat.apache.org/tomcat-8.0-doc/cluster-howto.html
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="8">
-
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getR
-
数据库及内存设置
-
修改mysql驱动版本,修改包名,重新编译,修改url
-
java调用nacos配置
-
HttpUtil访问https的问题,SunCertPathBuilderException:unable to find valid certification path to requested target
-
Java环境变量
-
#通过top查看内存占用情况
# 查看内存占用,rsz为实际内存,单位kb
# ps -eo 'pid,rsz,vsz' | grep pid
# 查看系统信息
# jinfo -sysprops pid
# 查看JVM信息
# jinfo -flags pid
#通过jmap查看堆内存
# jmap -heap pid
# dump内存进行分析
#jmap -dump:for
-
原始数据为十六进制,转换成十进制后得到标准数据
-
javax.annotation.PostConstruct rt.jar中定义 是Java自带的注解,在方法上加该注解会在项目启动的时候执行该方法,也可以理解为在spring容器初始化的时候执行该方法。 从Java EE5规范开始,Servlet中增加了两个影响Servlet生命周期的注解 PostConstruct和PreDestroy,这两个注解被用来修饰一个非静态的void()方法。
-
ApplicationContextAware(org.springframework.context.ApplicationContextAware) 当一个类实现了这个接口之后,这个类就可以方便的获得ApplicationContext对象(spring上下文),Spring发现某个Bean实现了ApplicationContextAware接口,Spring容器会在创建该Bean之后,自
-
Date date = org.anyline.util.DateUtil.parse("2022-07-25T12:37:06.101Z"); System.out.println(DateUtil.format(date)); 输出2022-07-25 20:37:06.101
-
new出来的拦截器Spring管理不了,所以 @Configuration public class WebConfig implements WebMvcConfigurer { @Bean("dp.sso.interceptor") public SSOInterceptor ssoInterceptor(){ return new SSOInterceptor(); } publ
-
http上传文件或上传byte[]
-
BYTE无符号单字节整型(字节,8位) WORD无符号双字节整型(字,16位) DWORD 无符号四字节整型(双字,32位) BYTE[n] n字节 String ASCII字符码
-
T表示一个分隔符 Z表示了UTC时间。UTC就是0时区的区时 +08表示时区为东八区,比零时区快八个小时 UTC是协调世界时,协调世界时,又称世界统一时间,世界标准时间,国际协调时间,简称UTC UTC相当于本初子午线(即经度0度)上的平均太阳时,过去曾用格林威治平均时(GMT)来表示. 北京(东八区)时间比UTC时间早8小时,也就是数值在大8小时 以2000年1月1日0000UTC为例,UTC时间是0点,北京时间为1999年1月1日早上8点整。