- 博客(57)
- 收藏
- 关注
原创 java性能优化-String对象的优化
如果调用 intern 方法,会去查看字符串常量池中是否有等于该对象的字符串,如果没有, 就在常量池中新增该对象,并返回该对象引用;具体做法就是,在每次赋值的时候使用 String 的 intern 方法,如果常量池中有相同值,就会重复使用该对象,返回对象引用,这样一开始的对象就可以被回收掉。在一开始创建 a 变量时,会在堆内存中创建一个对象,同时会在加载类时,在常量池中创 建一个字符串对象,在调用 intern 方法之后,会去常量池中查找是否有等于该字符串的对 象,有就返回引用。
2024-01-15 11:33:26 968
原创 JVM内存分配和垃圾收集
Java虚拟机栈描述的是Java方法执行的线程内存模型:每个方法执行的时候,Java虚拟机都会同步创建一个栈帧用于存储局部变量表、操作数栈、动态链接、方法出口等信息。主流商用程序语言的内存管理系统都是使用可达性分析算法来判断对象是否存活,这个算法的基本思路是通过一系列的“GC Goots”的根对象作为起始节点集,从这些节点开始,,根据引用关系向下搜索,搜索过程所走过的路径被称为引用链,如果这个对象到GC Root没有引用链相连就证明对象不可能在被使用了。在方法区常量引用的对象,譬如字符串常量池里的引用。
2023-03-28 16:49:29 474 1
原创 java基础-swing图形界面-按钮
2.基本示例public class TestJButton extends JFrame{ //面板 private JPanel jPanel; //测试按钮 private JButton jButton; public TestJButton(){
2021-12-01 16:51:24 1868
原创 springboot源码分析-内嵌tomcat启动流程分析
1.继承图2.概述我们一般都是使用的web环境,也就是创建的上下文是AnnotationConfigServletWebServerApplicationContext这个上下文,调用refresh这个方法时,会根据自动装配的是tomcat还是其他web服务器来创建一个webserver并启动3.源码springboot源码-AnnotationConfigServletWebServerApplicationContext_LouD_dm的博客-CSDN博客springboot源.
2021-10-05 11:57:44 288
原创 springboot源码-ServletWebServerApplicationContext
/* * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https.
2021-10-05 09:57:42 867
原创 springboot源码-AnnotationConfigServletWebServerApplicationContext
/* * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https.
2021-10-05 09:55:29 1321
原创 springboot源码-SpringApplication
/* * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https.
2021-10-04 13:10:09 185
原创 springmvc拦截器源码分析-HandlerInterceptor接口
1.概述spring会加载所有实现了HandlerInterceptor的bean,这里使用的是拦截器设计模式,在请求处理前调用拦截器的preHandle方法,在处理完成调用拦截器的postHandle方法,在渲染完成后调用拦截器的afterCompletion方法2.源码/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0
2021-09-21 19:25:16 200
原创 springmvc组件HandlerAdapter源码分析-HttpRequestHandlerAdapter
1.springmvc中HttpRequestHandlerAdapter继承体系2.概述HttpRequestHandlerAdapter处理实现了HttpRequestHandler接口的处理器,处理请求直接调用HttpRequestHandler接口的handleRequest方法,它和SimpleControllerHandlerAdapter不同的是SimpleControllerHandlerAdapter返回ModelAndView,而HttpRequestHandlerAdap
2021-09-21 19:14:23 183
原创 springmvc组件HandlerAdapter源码-HttpRequestHandlerAdapter
/* * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https.
2021-09-21 19:11:55 124
原创 springmvc组件HandlerAdapter源码分析-SimpleControllerHandlerAdapter
1.springmvc中SimpleControllerHandlerAdapter继承体系2.概述SimpleControllerHandlerAdapter处理实现了Controller接口的处理器,处理请求直接调用Controller接口的handleRequest方法3.SimpleControllerHandlerAdapter源码springmvc组件HandlerAdapter源码-SimpleControllerHandlerAdapter_LouD_dm的博客-CSD
2021-09-21 19:01:58 180
原创 springmvc组件HandlerAdapter源码-SimpleControllerHandlerAdapter
/* * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https.
2021-09-21 18:58:18 165
原创 springmvc组件HandlerAdapter源码分析-RequestMappingHandlerAdapter
1.springmvc中RequestMappingHandlerAdapter继承体系2.概述首先,RequestMappingHandlerAdapter实现了InitializingBean接口,bean初始化是会调用afterPropertiesSet方法来处理加了ControllerAdvice注解的类加载HandlerMethodArgumentResolver参数解析器处理参数加载处理InitBinder的HandlerMethodArgumentResolver参..
2021-09-21 16:42:17 328
原创 下载文件前台无法获取到total展示进度条问题
import org.springframework.boot.web.servlet.FilterRegistrationBean;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.web.filter.ShallowEtagHeaderFilter;import jav.
2021-09-15 16:17:28 311
原创 springmvc组件HandlerAdapter源码-AbstractHandlerMethodAdapter
/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https.
2021-09-12 22:43:32 257
原创 springmvc组件HandlerAdapter源码分析-AbstractHandlerMethodAdapter
1.springmvc中AbstractHandlerMethodAdapter继承体系2.概述AbstractHandlerMethodAdapter实现了HandlerAdapter接口表明是适配器,主要是处理HandlerMethod类型的处理程序,也就是处理加了@requestmapping注解的处理器,AbstractHandlerMethodAdapter实现了HandlerAdapter的supports方法,表明这个适配器是否支持处理器,实现了handle方法实际处理..
2021-09-12 22:22:01 160
原创 springmvc组件HandlerAdapter源码-AbstractHandlerMethodAdapter
/* * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https.
2021-09-12 22:15:42 140
原创 springmvc组件HandleMapping源码分析-RequestMappingHandlerMapping
1.RequestMappingHandlerMapping继承图2.概述通过加controller注解或requestmapping的类来作为处理器,每次请求都会到加了requestmapping的方法3.RequestMappingHandlerMapping源码翻译后的https://blog.csdn.net/qq_39482039/article/details/1197654414....
2021-08-18 11:48:39 223
原创 springmvc组件HandleMapping源码-RequestMappingHandlerMapping
/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https.
2021-08-17 20:36:48 241
原创 springmvc组件HandleMapping源码分析-AbstractHandlerMethodMapping
1.AbstractHandlerMethodMapping继承图2.概述AbstractHandlerMethodMapping继承了AbstractHandlerMapping,同时实现了InitializingBean接口,初始化时会调用afterPropertiesSet,同时重写了getHandlerInternal方法
2021-08-16 22:32:54 289
原创 springmvc组件HandleMapping源码-AbstractHandlerMethodMapping
/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https.
2021-08-15 21:47:18 293
原创 springmvc组件HandleMapping源码分析-AbstractHandlerMapping
1.AbstractHandlerMapping继承图2.概述AbstractHandlerMapping继承了WebApplicationObjectSupport,会默认调用initApplicationContext方法,具体在ApplicationObjectSupport,这个类实现了ApplicationContextAware接口,web容器启动会自动调用setApplicationContext方法设置applicationContext,ApplicationObjectSup
2021-08-08 21:04:05 228
原创 springmvc组件HandleMapping源码-AbstractHandlerMapping
/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https.
2021-08-08 20:53:57 129
原创 springmvc组件HandleMapping源码分析-AbstractUrlHandlerMapping
1.AbstractUrlHandlerMapping继承图2.概述AbstractUrlHandlerMapping主要覆盖了AbstractHandlerMapping中的getHandlerInternal方法,根据请求的url获取到对应的处理器程序3.AbstractUrlHandlerMapping源码翻译后的https://blog.csdn.net/qq_39482039/article/details/1192549264.getHandlerInternal方法.
2021-08-08 19:41:53 102
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人