自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

翻译 第二部分、其他(Thymeleaf官方文档翻译)

原文:文档5-13节2. 设置属性值2.1 给任意属性赋值使用th:attr可以给任意标签进行属性赋值,举例如下:<form action="subscribe.html" th:attr="action=@{/subscribe}"> <fieldset> <input type="text" name="email" /> <input type="submit" value="Subscribe!" th:attr="value=#

2020-07-02 15:36:39 796

翻译 第一部分、标准模板语法(Thymeleaf官方文档翻译)

原文 4 Standard Expression Syntax1.标准模板语法下面使用xmlns的目的是防止IDE软件提示缺少th:*的命名空间,可以不用xmlns<html xmlns:th="http://www.thymeleaf.org">在HTML5文档里,下面的两种语法完全等效,即th:*与data-th-*等效。唯一的不同是data-th-*的语法只能在HTML5文档中使用<p data-th-text="#{home.welcome}">Welco

2020-07-02 15:31:41 290

翻译 跨站请求伪造相关内容(摘自Spring Security 5.0.6.RELEASE手册)

跨站请求伪造相关内容摘自Spring Security手册19. Cross Site Request Forgery (CSRF)This section discusses Spring Security’s Cross Site Request Forgery (CSRF) support.19.1 CSRF AttacksBefore we discuss how Spring Security can protect applications from CSRF att

2020-07-02 15:22:16 332

原创 后台手动渲染Thymeleaf模板,然后返回HTML给前端

后台手动渲染Thymeleaf模板,然后返回HTML给前端public class MyController { @Autowired private ThymeleafViewResolver thymeleafViewResolver; @Autowired private ObjectMapper objectMapper; @GetMapping(value = "/html", produces = {MediaType.TEXT_HTML_VALUE

2020-07-01 17:35:30 1139

原创 配置swagger,让其支持spring Pageable接口作为ApiModel

配置swagger,让其支持spring Pageable接口作为ApiModeljava配置import org.springframework.data.domain.Pageable;@Configuration@EnableSwagger2public class SwaggerConfig { @Bean public Docket docket(){ return new Docket(DocumentationType.SWAGGER_2).apiIn

2020-07-01 17:33:37 655

原创 配置h2内存数据库,支持geometry空间数据类型

配置h2内存数据库,支持geometry数据类型pom.xml <repositories> <repository> <id>osgeo</id> <name>OSGeo Release Repository</name> <url>https://repo.osgeo.org/repository/release/<

2020-07-01 17:32:18 1036

转载 第十一节、虚拟机调优的其他考虑因素(官方文档抄录)

原文: https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/considerations.html11 Other ConsiderationsThis section covers other situations that affect garbage collection.Finalization and Weak, Soft, and Phantom ReferencesSome applications in

2020-07-01 17:21:10 134

转载 第十节、G1虚拟机调优(官方文档抄录)

原文:https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/g1_gc_tuning.html10 Garbage-First Garbage Collector TuningThis section describes how to adapt and tune the Garbage-First garbage collector (G1 GC) for evaluation, analysis and performa

2020-07-01 17:19:11 424

转载 第九节、G1垃圾收集器(官方文档抄录)

原文https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/g1_gc.html9 Garbage-First Garbage CollectorThe Garbage-First(G1) garbage collector is a server-style garbage collector, targeted for multiprocessor machines with large memories. It atte

2020-07-01 17:17:32 466

转载 第八节、标记清除收集器(官方文档抄录)

原文:https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/cms.html8 Concurrent Mark Sweep (CMS) Collector 标记清除收集器The Concurrent Mark Sweep (CMS) collector is designed for applications that prefer shorter garbage collection pauses and that can

2020-07-01 17:15:56 746

转载 第七节、并发垃圾收集器(官方文档抄录)

原文:https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/concurrent.html7 The Mostly Concurrent CollectorsJava Hotspot VM has two mostly concurrent collectors in JDK 8:Concurrent Mark Sweep (CMS) Collector: This collector is for applicati

2020-07-01 17:13:09 252

原创 第六节、并行垃圾收集器The Parallel Collector(官方文档抄录)

原文:https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/parallel.html6 The Parallel CollectorThe parallel collector (also referred to here as the throughput collector) is a generational collector similar to the serial collector; the primary

2020-07-01 17:09:11 379

原创 第五节、Java8可用垃圾收集器(Standard Edition HotSpot Virtual Machine Garbage Collection Tuning官方文档抄录)

原文:https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/collectors.html5 Available CollectorsThe discussion to this point has been about the serial collector. The Java HopSpot VM includes three different types of collectors, each with diffe

2020-07-01 17:06:19 197

原创 第四节、调整Generation大小(Standard Edition HotSpot Virtual Machine Garbage Collection Tuning官方文档抄录)

4 Sizing the GenerationsA number of parameters affect generation size. Figure 4-1, “Heap Parameters” illustrates the difference between committed space and virtual space in the heap. At initialization of the virtual machine, the entire space for the heap

2020-07-01 16:49:44 235

原创 第三节、虚拟机年代划分(Java Platform, Standard Edition HotSpot Virtual Machine Garbage Collection Tuning官方文档抄录)

3 GenerationsEfficient collection is made possible by focusing on the face that a majority of objects ‘die young.’????Generations : is memory pools holding objects of different ages.????Minor collection: When the young generation fills up, it causes a m

2020-07-01 16:45:44 181

原创 Java对象序列化

Java对象序列化的意义在于,可以将Java对象转换成字节数据,保存在磁盘上,或者直接通过网络传播。同时通过反序列化可以把保存在磁盘,或者网络上的java字节数据恢复成原来的对象。所以序列化使Java对象可以脱离程序而独立存在。Java类实现可序列化的要求是,实现下面的两个接口之一: Serializable Externalizable一、使用对象流实现序列化两个步骤实现序列化:创建ObjectOutputStream处理流//处理流必须建立在节点流FileOutputStrea

2020-07-01 16:25:28 182

原创 HashMap的容量为什么是2的幂次方

HashMap 的容量为什么是2的幂次方为了能让 HashMap 存取高效,尽量较少碰撞,也就是要尽量把数据分配均匀。我们上面也讲到了过了,Hash 值的范围值-2147483648到2147483647,前后加起来大概40亿的映射空间,只要哈希函数映射得比较均匀松散,一般应用是很难出现碰撞的。但问题是一个40亿长度的数组,内存是放不下的。所以这个散列值是不能直接拿来用的。用之前还要先做对数组的长度取模运算,得到的余数才能用来要存放的位置也就是对应的数组下标。这个数组下标的计算方法是“ (n - 1) &

2020-07-01 16:23:00 629

原创 Java中的一些基本概念

进程 process 和 线程 thread两个名词都是对CPU时间段的描述。进程就是包括CPU上下文切换和程序执行时间的总和 = CPU加载上下文 + CPU执行 + CPU保存上下文进程是资源分配的最小单位,由操作系统分配,任意时刻,CPU总是运行一个进程,其他的进程处于非运行状态。线程由程序自己分配,线程共享了进程的上下文环境,是比进程更小的CPU时间段。一个进程可以包含多个线程,进程在执行时,CPU会在进程的线程之间来回切换,所以线程是CPU调度的最小单位。对于Java程序来说,多个.

2020-07-01 16:15:28 305

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除