@Resource @Lazy 不兼容
须要应用@Autowired + @Lazy
SpringBoot 部署动态资源
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>
resource目录下新建 static文件夹
将动态资源放入 static文件夹
通过 域名/文件名 进行拜访
如
resource/static/1.txtresource/static/test/2.txt
则通过以下地址拜访
www.xxx.com/1.txtwww.xxx.com/test/2.txt
计算运行时对象占用内存
lucene提供的用于计算堆内存占用大小工具类:RamUsageEstimator
<dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-core</artifactId> <version>4.0.0</version></dependency>//计算指定对象及其援用树上的所有对象的综合大小,单位字节long RamUsageEstimator.sizeOf(Object obj)//计算指定对象自身在堆空间的大小,单位字节long RamUsageEstimator.shallowSizeOf(Object obj)//计算指定对象及其援用树上的所有对象的综合大小,返回可读的后果,如:2KBString RamUsageEstimator.humanSizeOf(Object obj)
Swagger 测试接口增加 Header
@ApiImplicitParams(value = {@ApiImplicitParam(paramType = "header", name = "access-token", required = true)