Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

Netkiller Java 手札(2025版)

Java, Servlet, JavaBean, Struts, Spring ...

Mr. Neo Chan, 陈景峯(BG7NYT)



中国广东省深圳市望海路半岛城邦三期
518067
+86 13113668890


文档始创于 2015-11-10

电子书最近一次更新于 2025-11-16 07:51:04

版权声明

转载请与作者联系,转载时请务必标明文章原始出处和作者信息及本声明。

http://www.netkiller.cn
http://netkiller.github.io
http://netkiller.sourceforge.net
微信公众号: netkiller
微信:13113668890 请注明“读者”
QQ:13721218 请注明“读者”
QQ群:128659835 请注明“读者”
知乎专栏

2017-11

关于《Netkiller Java 手札》

作者2002年开始在项目中使用Java,各种原因没有留下Java文档,2015因工作需要重新拾起Java并整理本文档。

本电子书重点内容是Spring boot, Spring cloud, Spring data, Spring security


致读者

Netkiller 系列手札 已经被 Github 收录,并备份保存在北极地下250米深的代码库中,备份会保留1000年。

Preserving open source software for future generations

The world is powered by open source software. It is a hidden cornerstone of modern civilization, and the shared heritage of all humanity.

The GitHub Arctic Code Vault is a data repository preserved in the Arctic World Archive (AWA), a very-long-term archival facility 250 meters deep in the permafrost of an Arctic mountain.

We are collaborating with the Bodleian Library in Oxford, the Bibliotheca Alexandrina in Egypt, and Stanford Libraries in California to store copies of 17,000 of GitHub’s most popular and most-depended-upon projects—open source’s “greatest hits”—in their archives, in museum-quality cases, to preserve them for future generations.

https://archiveprogram.github.com/arctic-vault/

目录

1. 自述
1.1. 写给读者
1.2. 作者简介
1.3. 如何获得文档
1.4. 打赏(Donations)
1.5. 联系方式
I. Java 21
1. JVM
1.1. Java 21
1.2. Almalinux / RockyLinux
1.3. CentOS 8 Java 14
1.4. Java 版本切换
1.5. 安装 Java 6
1.5.1. HeapDumpOnOutOfMemoryError
1.6. java-1.8.0-openjdk
1.7. docker 环境
1.8. java - Launches a Java application.
1.8.1. java 9~11
1.8.2. -verbose:class 显示载入jar文件
1.8.3. java.io.tmpdir
1.8.4. 显示版本号
1.8.5. 列出java模块
1.9. Java 相关命令
1.9.1. jps
1.9.2. jar
1.9.3. jdeps - Java class dependency analyzer.
1.9.4. JShell
1.9.5. jlink
2. exec 运行shell
2.1. System
2.1.1. System
2.1.2. System.in 标准输入(Stdin)
2.1.3. ANSI Color
3. 数据类型
3.1. var 本地变量类型推断
3.2. Integer 整形
3.2.1. 字符串转整数
3.2.2. 进制转换
3.2.3. 前面补零
3.2.4. NumberFormat 数字格式化
3.2.5. 从字符串中提取数字
3.3. String 字符串
3.3.1. 查找字符重现的位置
3.3.2. 行数统计
3.3.3. 复制字符串
3.3.4. 随机字符串
3.3.5. 字符串替换处理
3.3.6. substring
3.3.7. string to timestamp
3.3.8. String.strip
3.3.9. 文本块
3.3.10. 分割字符串
3.3.11. String.format 字符串格式化
3.3.12. DecimalFormat 文本格式化
3.3.13. 通过 stream() 匹配一组字符串
3.3.14. 字符串输出转译字符串
3.4. 类型转换
3.4.1. Long to String
3.5. Date 日期时间
3.5.1. String to Date
3.5.2. DateTimeFormatter 格式化日期和时间
3.5.3. SimpleDateFormat 格式化日期和时间
3.5.4. Timestamp
3.5.5. TimeZone
3.5.6. 比较两个日期与时间
3.5.7. Calendar
3.5.8. getToday
3.5.9. Yesterday
3.5.10. ISO 8601
3.5.11. LocalDateTime
3.5.12.
3.5.13. 计算流逝时间
3.6. Array 数组
3.6.1. 字符串转数组
3.6.2. for each
3.6.3. Array to String
3.6.4. 数据转字符串
3.6.5. 字符串转数组
3.7. float 浮点
3.8. double 双精度浮点
3.8.1. String to double
3.8.2. 百分数转Double
3.8.3. Double转百分数
3.9. BigDecimal
3.9.1. Convert BigDecimal Object to double value
3.9.2. 去除末尾多余的0
3.9.3. 禁用科学计数法
3.9.4. 移动小数点位置
3.10. StringBuffer
3.11. enum
3.12. byte 类型
3.12.1. string2byte
3.12.2. 初始化 byte[] 填充数据 0
3.12.3. byte[] to String
3.12.4. BigInteger2byte
3.12.5. int to byte array
3.12.6. byte array to int
3.12.7. byte2char
3.12.8. longToByte64
3.12.9. byte64ToLong
3.12.10. short2byte
3.12.11. byte8ToDouble
3.12.12. byte4ToFloat
3.12.13. 无符号 byte
3.12.14. byte to hex
3.12.15. byte[] to hex
3.12.16. 连接两个 byte[]
3.12.17. List<Byte> to byte[]
3.13. 布尔型 Boolean
4. 流程控制
4.1. Switch
4.1.1. yield
5. 面向对象
5.1. 可变参数
5.2. 泛型
5.2.1. 范型演示
5.2.2. 数组泛型方法
5.2.3. 静态方法
5.2.4. 可变参数的泛型方法
5.2.5. 返回泛型值
5.2.6. 泛型类
5.3. record
5.3.1. 在 Record 中定义范型
5.4. Callback 回调
5.5. 密封类
5.5.1.
6. 异常处理
6.1. 抛出异常
6.2. try-with-resources
6.3. SneakyThrows
6.3.1. 处理所有异常 Exception
6.3.2. 处理特定异常
6.3.3. 抛出异常
7. Java 线程
7.1. 多线程 Lambda 表达式
7.2. 实现异步执行
7.3. 继承 Thread 类实现多线程
7.3.1. 设置线程名称
7.3.2. 判断线程是否存活
7.3.3. 获取线程状态
7.4. 实现 Runnable 接口
7.5. 线程同步
7.6. ThreadLocal
7.7. ScopedValue
7.8. ThreadLocalMap
7.9. InheritableThreadLocal
7.10. 守护线程
7.11. 线程等待与线程通知
7.11.1. 通知所有线程
7.11.2. 携带消息
II. JDK Development Kit
8. 数据结构
8.1. Collection 接口
8.2. List
8.2.1. 静态 List
8.2.2. List.of()
8.2.3. List.copyOf()
8.2.4. String[] to List
8.2.5. Stream.toList() 方法
8.2.6. containsAll
8.2.7.
8.2.8. 随机 List
8.2.9. getFirst() / getLast()
8.2.10. List 转 Array
8.3. ArrayList
8.3.1. 初始化
8.3.2. 判断元素是否存在
8.3.3. 循环打印
8.3.4. ArrayList to Array
8.3.5. ArrayList to String
8.3.6. Array to List
8.3.7. List to Array
8.3.8. ArrayList forEach
8.3.9. ArrayList stream()
8.3.10. ArrarList 转换为 string[]
8.3.11. string 转换为 ArrayList
8.3.12. ArrayList 转换为 string
8.3.13. string[] 转换为 ArrarList
8.3.14. 合并 List<byte[]> ArrayList<byte[]>
8.4. LinkedList
8.5. Vector
8.6. Set
8.6.1. Set 初始化
8.6.2. Set 转为 List
8.6.3. Set.of()
8.6.4. Set to Array
8.7. Map
8.7.1. 初始化
8.7.2. HashMap
8.7.3. LinkedHashMap
8.7.4. 遍历数据
8.7.5. 迭代器
8.7.6. Map forEach
8.7.7. 随机取值
8.7.8. 有序 Key 值,HashMap 与 LinkedHashMap 对比
8.7.9. 调换 map 的 key 与 value 位置
8.8. Iterator
8.8.1. List 迭代
8.8.2. 处理剩余结果
8.8.3. Map 迭代
8.8.4. Iterator 与 List 的区别
8.8.5. remove() 删除操作
8.8.6. Iterable 转 List
8.8.7. ListIterator
8.8.8. Iterable
8.9. Queue
8.9.1. 阻塞队列
8.9.2. LinkedBlockingQueue
8.9.3. Deque 双端队列
8.9.4. 数据转换
8.9.5. PriorityBlockingQueue
8.10. Stack
8.11. Optional
8.11.1. of() 为非null的值创建一个Optional。
8.11.2. ofNullable() 为指定的值创建一个Optional,如果指定的值为null,则返回一个空的Optional。
8.11.3. isPresent 如果值存在返回true,否则返回false。ifEmpty() null 返回 true 否则返回 false
8.11.4. ifPresent() 如果Optional实例有值执行 lambda 表达式
8.11.5. get() 返回值
8.11.6. orElse 如果有值则将其返回,否则返回指定的其它值。
8.11.7. orElseGet与orElse方法类似,区别在于得到的默认值从 Supplier 返回。
8.11.8. orElseThrow 如果有值则将其返回,否则抛出supplier接口创建的异常
8.11.9. map() 方法用来对Optional实例的值执行一系列操作
8.11.10. flatMap()
8.11.11. filter() 通过传入限定条件过滤Optional值
8.11.12. stream()
8.11.13. or()
8.11.14. example
9. 正则表达式
9.1. 正则查找
9.2. 正则替换
9.3. 字符串分割
10. Java 并发编程
10.1. TimeUnit
10.2. ThreadLocalRandom
10.3. 原子变量
10.3.1. AtomicInteger / AtomicLong
10.3.2. AtomicBoolean
10.3.3. AtomicReference
10.3.4. 值设置与获取操作
10.4. ReentrantLock 锁
10.5. 线程安全的 HashMap(ConcurrentHashMap)
10.5.1. 设置键与值
10.6. CopyOnWriteArraySet
10.7. 队列 / 阻塞队列
10.7.1. ConcurrentLinkedQueue 非阻塞队列
10.7.2. ArrayBlockingQueue
10.7.3. LinkedBlockingQueue
10.7.4. PriorityBlockingQueue
10.7.5. ConcurrentLinkedQueue
10.7.6. LinkedTransferQueue
10.7.7. LinkedBlockingQueue LinkedTransferQueue ConcurrentLinkedQueue
10.8. Future
10.8.1. Future + Stream 管理一组线程
10.8.2. Future + ExecutorService
10.9. FutureTask
10.10. StructuredTaskScope
10.11. CompletableFuture
10.11.1. 创建 CompletableFuture 实例,并且其他线程中使用
10.11.2. runAsync 创建没有返回值的异步任务
10.11.3. thenRun / thenRunAsync
10.11.4. supplyAsync 创建带有返回值的异步任务。
10.11.5. thenAccept / thenAcceptAsync
10.11.6. 获取结果
10.11.7. thenApply / thenApplyAsync
10.11.8. runAsync / thenAccept / thenApply 区别
10.11.9. whenComplete 任务完成时执行,并且返回结果和异常
10.11.10. 超时处理
10.11.11. 按顺序执行
10.11.12. thenCombine、thenAcceptBoth 和runAfterBoth
10.11.13. applyToEither、acceptEither和runAfterEither
10.11.14. allOf / anyOf
10.11.15. 并行执行 CompletableFuture
10.11.16. 通知完成任务
10.11.17. 异常处理
10.11.18. CompletableFuture 实现 Pipeline 流水线
10.12. java 线程池
10.12.1. newCachedThreadPool
10.12.2. 固定线程池(newFixedThreadPool)
10.12.3. Executors.newScheduledThreadPool
10.12.4. SingleThreadExecutor
10.12.5. ExecutorService 正确关闭方法
10.12.6. ForkJoinPool / ForkJoinTask
10.13. Flow
10.13.1. 自定义 Publisher / Subscriber
10.13.2. SubmissionPublisher
10.13.3. Flow.Processor
10.13.4. 订单
10.14. Java 协程
11. Stream
11.1. Stream.of
11.2. Stream.ofNullable
11.3. filter
11.4. map
11.5. peek 打印调试信息
11.6. limit/skip
11.7. sorted
11.8. distinct
11.9. forEach
11.10. count
11.11. 流转列表
11.12. collect
11.12.1. Collectors.toList() 列表转字符串
11.12.2. Collectors.joining() 连接字符串
11.12.3. 转 Set Collectors.toSet()
11.12.4. Collectors.teeing()
11.13. takeWhile 和 dropWhile
11.14. 合并 Stream
11.15. mapToObj
11.16. Collectors
11.16.1.
11.16.2. 过滤空值
11.17. 混合使用的例子
11.17.1. List to Stream
11.18. 流复用 streamSupplier
11.19. Parallel Streams(并行流)
11.20. IntStream
11.21. LongStream
11.22. DoubleStream
11.23. 例子
11.23.1. Markdown 转 CSV
12. 函数式编程
12.1. Supplier 供应型的接口
12.1.1. Supplier 作为方法参数使用
12.1.2. IntSupplier
12.1.3. LongSupplier
12.1.4. DoubleSupplier
12.1.5. BooleanSupplier
12.2. Consumer 消费型的接口
12.2.1. IntConsumer
12.2.2. 无返回值 Void
12.3. BiConsumer
12.4. BiFunction
12.5. Predicate 判断型的接口
12.6. Supplier / Consumer / Predicate 应用场景
13. Util
13.1. Properties 处理 *.properties 文件
13.1.1. 打开 properties 文件
13.1.2. propertyNames()
13.1.3. keySet()
13.1.4. entrySet()
13.1.5. 方法中返回 Properties
13.1.6.
13.1.7. getResourceAsStream()
13.1.8. store
13.1.9. 实现国际化
13.2. Logging
13.2.1. console
13.3. BASE64
13.4. Locale 国际化
13.5. ResourceBundle
13.6. Scanner
13.7. UUID
13.8. Arrays.equals 判断两个数组是否相等
13.9. Random 随机字符串
13.9.1. 取 0-n 范围内随机数
13.9.2. 指定随机数范围
13.10. CRC32
13.11. Timer / TimerTask 实现周期性重复执行
14. 时间
14.1. LocalDate
14.2. LocalTime
14.3. ZonedDateTime
14.4. DateTimeFormatter
14.5. Instant
14.6. Period :基于日期值
14.7. Duration:基于时间值
14.7.1. 设置指定单位的持续时间
14.7.2. 获取指定单位的持续时间
14.7.3. 获取两个时间点之间差值的持续时间
14.7.4. 获取毫秒
15. IO
15.1. 取出文件名中的扩展名
15.1.1. getAbsolutePath() 获取绝对路径
15.1.2. 创建目录 mkdir()
15.1.3. 文件删除
15.1.4. 临时文件
15.2. FileWriter 文本写入文件
15.3. Files
15.3.1. 删除文件
15.3.2. 创建目录和文件
15.4. BufferedWriter
15.5. PrintWriter
15.6. FileOutputStream
15.6.1. FileOutputStream + try 用法
15.6.2. OutputStreamWriter
15.7. FileInputStream
15.7.1. InputStreamReader
15.7.2. inputStream.transferTo()
15.8. Scanner
15.9. Files
15.9.1. Files.lines
15.9.2. Files.readAllLines
15.9.3. Files.readAllBytes
15.9.4. Files.newBufferedReader
15.10. 二进制文件
15.10.1. 理解二进制文件
15.10.2. byte 类型
15.10.3. boolean 布尔型
15.10.4. Long 型
15.10.5. char 类型
15.10.6. UTF 字符串
15.10.7. Short 类型
15.10.8. float 单精度浮点类型
15.10.9. double 数据类型
15.10.10. 二进制文件操作演示
15.11. 路径操作汇总
15.11.1. 获得 Resource 下文件路径
15.11.2. URI/相对/拒绝/路径/文件
15.11.3. URL 操作汇总
15.11.4. nio 路径库
15.12. 遍历目录和文件
15.12.1. listFiles()
15.12.2. Files.newDirectoryStream
15.12.3. Files.list
15.12.4. Files.walk 递归遍历目录
15.12.5. SimpleFileVisitor
16. Network
16.1. URL
16.1.1. 获取路径/文件名
16.1.2. 打开 URL
16.2. URLConnection
16.3. HttpURLConnection
16.3.1. GET 请求
16.3.2. POST 请求
16.3.3. POST JSON
16.4. 获取IP地址何机器名
17. JDBC
17.1. 安装 JDBC 包
17.2. MySQL
17.3. Oracle
17.3.1. SID
17.3.2. SERVICE_NAME
17.3.3. TNS
17.3.4. Oracle RAC Cluster
17.3.5. Oracle JDBC Demo
17.4. FAQ
17.4.1. java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
17.4.2. Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
18. Reflection 反射
18.1. 获得所有变量
18.2. 批量赋值
18.3. 方法操作
18.3.1. 获得所有方法
18.3.2. set/get 方法
18.3.3. static 方法调用
18.4. 完成的例子
19. java.security
19.1. 列出 Java 支持的数字摘要算法
19.2. 计算文件的 MD5,SHA 等 HASH 值
19.3. Md5sum
20. javax
20.1. java 脚本引擎
20.1.1. Maven
20.1.2. Helloworld
20.1.3. 运行脚本文件
20.1.4. 变量传递
20.1.5. 全局变量与局部变量定义
20.1.6. 调用脚本中的函数或方法
20.1.7. 脚本编译
20.1.8. jjs - Invokes the Nashorn engine.
20.2. Crypto
20.2.1. MD5
20.2.2. AES
20.2.3. AES/CBC/PKCS5PADDING
20.2.4. DES
III. Build Tools
21. Apache Ant
21.1. 安装 ant
21.1.1. 1.8
21.1.2. 1.10.1
21.2. ANT
21.2.1. ant.project.name
21.2.2. 定义
21.3. Project
21.3.1. property
21.3.2. ant
21.3.3. environment
21.4. path
21.5. copy
21.6. javac
21.7. condition
21.8. exec
21.8.1. sshexec
21.9. if
21.10. macrodef
21.10.1. Git
21.10.2. Rsync
21.10.3. SSH
21.10.4. maven
21.11. Javascript
21.12. mail
21.13. basename
21.14. 创建文件
21.15. FAQ
21.15.1. warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
21.15.2. 调试 exec
22. Apache Ivy
22.1. Ivy Install
22.1.1. source code
22.1.2. apt-get
22.2. Test example
23. Apache Maven
23.1. 安装 Maven
23.1.1. CentOS 8 安装 Maven
23.1.2. Ubuntu
23.1.3. 一键安装
23.1.4. apache-maven-3.8.2
23.1.5. Nexus Repository OSS
23.1.6. MacOS
23.1.7. mvnd
23.2. Maven 命令
23.2.1. 切换 JAVA 版本
23.2.2. 参数
23.2.3. -s 指定 settings.xml 文件
23.2.4. 多线程
23.2.5. help
23.2.6. archetype:create
23.2.7. 从 archetype 模版创建项目
23.2.8. clean
23.2.9. compile
23.2.10. 编译测试代码
23.2.11. test
23.2.12. package
23.2.13. install
23.2.14. war
23.2.15. exec
23.2.16. dependency
23.2.17. jar
23.2.18. 构建装配Maven Assembly
23.2.19. 加密密码
23.2.20. help:describe
23.3. settings.xml 配置
23.3.1. Maven 仓库
23.3.2. 镜像配置
23.4. pom.xml
23.4.1. properties
23.4.2. 常用的POM属性
23.4.3. repositories 仓库配置
23.4.4. dependencies
23.4.5. dependencyManagement
23.4.6. build
23.4.7. plugins
23.5. Maven Module
23.5.1. Parent
23.5.2. 公共项目 common
23.5.3. 常规项目
23.5.4. 现在测试效果
23.6. 依赖管理
23.6.1. 创建依赖模块
23.6.2. 引用依赖管理
23.7. plugins
23.7.1. maven-compiler-plugin
23.7.2. maven-war-plugin
23.7.3. maven-antrun-plugin
23.7.4. maven-install-plugin
23.7.5. maven-surefire-plugin
23.7.6. maven-deploy-plugin
23.7.7. maven-jar-plugin
23.7.8. maven-dependency-plugin
23.7.9. spring-boot-maven-plugin
23.7.10. tomcat8-maven-plugin
23.7.11. docker-maven-plugin
23.8. 应用案例
23.8.1. 并行开发解决不同环境包引用
24. Gradle 5
24.1. 安装 Gradle
24.1.1. CentOS
24.1.2. Mac
24.1.3. Artifactory 本地仓库
24.2. Example
24.3. gradle 命令
24.3.1. tasks 列出任务
24.4. build.gradle
24.4.1. repositories
24.4.2. dependencies
24.4.3. jar
24.4.4. Task
24.5. gradle.properties
24.5.1. 列出 properties
24.5.2. 自定义 gradle.properties
24.5.3. ext
24.5.4. System.properties
24.6. Github Packages
24.6.1. Publishing a package
24.6.2. Using a published package
25. JitPack - Easy to use package repository for Git
IV. Spring Boot
26. Spring Boot Quick start
26.1. 创建项目
26.2. pom.xml
26.3. Controller
26.4. Springboot with Maven
26.4.1. resource
26.4.2. Maven run
26.4.3. Spring Boot maven 插件 build-image
26.4.4. 生成项目信息
27. Spring 开发环境
27.1. Java 开发环境
27.2. 安装 Spring Tool Suite
27.3. Dashboard
27.4. Spring Initializr - Bootstrap your application
28. SpringApplication
28.1. 运行 Spring boot 项目
28.1.1. Linux systemd
28.1.2. 传统 init.d 脚本
28.1.3. 编译用于Tomcat的 War
28.2. @SpringBootApplication
28.2.1. 排除 @EnableAutoConfiguration 加载项
28.3. 获取 Resources 目录中的静态文件
28.4. @EnableAutoConfiguration
28.5. @ComponentScan
28.6. @EntityScan 实体扫描
28.7. @EnableJpaRepositories
28.8. 启动和销毁
28.9. 打印环境变量
28.10. CharacterEncodingFilter
28.11. 隐藏 Banner
28.12. 实体与仓库扫描
28.13. 列出 Beans
28.14. Tomcat 端口
28.15. 配置项设定
28.16. spring.profiles.active
28.17. @Profile("dev") / @ActiveProfiles("dev")
28.18. 设置默认时区
29. 如何优雅停止 Springboot 运行
29.1. 准备工作
29.2. kill 命令演示
29.3. 容器中如何优雅关闭 Springboot
29.4. 写入PID文件
30. Properties 配置文件
30.1. application.properties 配置文件
30.1.1. application.properties 参考
30.1.2. 启动指定参数
30.1.3. 加载排除
30.1.4. PID FILE
30.1.5. banner 关闭
30.1.6. server
30.1.7. logging
30.1.8. 内嵌 tomcat server
30.1.9. servlet
30.1.10. JSON 输出与日期格式化
30.1.11. SMTP 相关配置
30.1.12. Redis
30.1.13. MongoDB
30.1.14. MySQL
30.1.15. Oracle
30.1.16. default_schema
30.1.17. datasource
30.1.18. velocity
30.1.19. Security 相关配置
30.1.20. MVC 配置
30.1.21. Kafka 相关配置
30.2. Properties 文件
30.2.1. @Value 注解
30.2.2. @EnableConfigurationProperties 引用自定义 *.properties 配置文件
30.2.3. @PropertySource 注解载入 properties 文件
30.3. Environment 读取配置文件
30.4. 手工载入 *.properties 文件
30.4.1. 家在 resources 目录中的指定文件
30.4.2. 从 InputStreamReader 打开 application.properties
30.5. 命令行注入配置项
30.5.1. spring.profiles.active 参数切换配置文件
30.5.2. SpringApplicationBuilder.properties() 方法添加配置项
30.5.3. 禁用命令行注入环境变量
30.6. PropertyResolver 获取配置
30.7. 参数引用
30.8. 默认值
30.9. 产生随机数
30.9.1. 随机数
30.10. 多行字符串
30.11. 注入多值属性 arrays, list, set
30.12. List 列表类型
30.13. Map类型
30.14. Binder
30.15. 加密 application.properties 中的敏感内容
31. Spring boot with Logging
31.1. 配置日志文件
31.1.1. 日志输出级别
31.1.2. Spring boot 2.1 以后的版本不打印 Mapped 日志问题
31.1.3. 禁止控制台输出日志
31.1.4. 定制日志格式
31.1.5. 彩色输出
31.2. 日志切割
31.3. 彩色日志
31.4. 打印日志
31.4.1. lombok
31.5. logback 配置详解
31.5.1. 标准输出
31.5.2. 禁止 logback 日志输出
31.5.3. 指定Class过滤日志
31.5.4. configuration 属性配置
31.5.5. contextName 设置上下文名称
31.5.6. property 设置变量
31.5.7. encoder 日志格式设置
31.5.8. RollingFileAppender
31.5.9. 日志过滤
31.5.10. 标准输出
31.5.11. MDC
31.5.12. 日志写入 MongoDB
31.5.13. 日志发送给 logstash
31.5.14. fluentd
31.5.15. Loki4j Logback
31.6. Log4j2 + Gelf + Logstash
31.6.1. Maven 配置
31.6.2. log4j2.xml 配置
31.6.3. Java 测试代码
31.6.4. Logstash 配置
31.6.5. 测试结果
31.6.6. Log4j2 更多技巧
31.7. 日志报警
31.7.1. Logstash 配置
31.7.2. 监控 SpringBootApplication 的启动和退出
31.8. Spring boot with ELK(Elasticsearch + Logstash + Kibana)
31.8.1. TCP 方案
31.8.2. Redis 方案
31.8.3. Kafka 方案
31.8.4. Other
32. Spring boot with Undertow
32.1. Maven 依赖
32.2. Application
32.3. 相关配置
33. Spring boot with Jetty
34. Spring boot with HTTP2 SSL
34.1. 生成自签名证书
34.2. application.properties 配置文件
34.3. 启动 Spring boot
34.4. restTemplate 调用实例
34.5. HTTP2
35. Spring boot with MongoDB
35.1. Maven
35.2. Application
35.3. MongoTemplate
35.4. Repository
36. Spring boot with MySQL
36.1. Maven
36.2. Resource
36.3. Application
36.4. JdbcTemplate
36.5. CrudRepository
37. Spring boot with Oracle
37.1. Maven
37.2. application.properties
37.3. Application
37.4. CrudRepository
37.5. JdbcTemplate
37.6. Controller
38. Spring boot with PostgreSQL
38.1. pom.xml
38.2. application.properties
38.3. Application
38.4. CrudRepository
38.5. JdbcTemplate
38.6. Controller
38.7. Test
39. Spring boot with Elasticsearch
39.1. Maven
39.2. Application
39.3. application.properties
39.4. Domain
39.5. ElasticsearchRepository
40. Spring boot with Elasticsearch TransportClient
40.1. Maven
40.2. Application
40.3. application.properties
40.4. ElasticsearchConfiguration
40.5. RestController
41. Spring boot with Apache Hive
41.1. Maven
41.2. application.properties
41.3. Configuration
41.4. CURD 操作实例
42. Spring boot with Phoenix
42.1. Maven
42.2. application.properties
42.3. Configuration
43. Spring boot with Datasource
43.1. Master / Slave 主从数据库数据源配置
43.1.1. application.properties
43.1.2. 配置主从数据源
43.1.3. 选择数据源
43.2. 多数据源配置
43.3. JPA 多数据源
44. 连接池配置
44.1. org.apache.tomcat.jdbc.pool.DataSource
44.2. druid
44.2.1. 加密数据库密码
44.3. c3p0 - JDBC3 Connection and Statement Pooling
44.4. dbcp2
44.5. bonecp
44.6. HikariPool
45. Spring boot with Queue
45.1. Spring boot with RabbitMQ(AMQP)
45.1.1. maven
45.1.2. RabbitMQConfig
45.1.3. 生产者
45.1.4. 消费者
45.2. Spring boot with Apache Kafka
45.2.1. 安装 kafka
45.2.2. maven
45.2.3. Spring boot Application
45.2.4. EnableKafka
45.2.5. KafkaListener
45.2.6. 测试
45.2.7. 完整的发布订阅实例
45.2.8. Spring cloud with Kafka
46. Spring boot with Scheduling
46.1. 启用计划任务
46.1.1. Application.java
46.1.2. 配置
46.1.3. Component
46.2. 计划任务控制开关
46.3. @Scheduled 详解
46.3.1. fixedRate 案例
46.3.2. timeUnit
46.4. cron 表达式
46.4.1. 每3秒钟一运行一次
46.4.2. 凌晨23点运行
46.4.3. 周一 ~ 周五
46.5. Timer 例子
46.6. ScheduledExecutorService 例子
47. Spring boot with Swagger
47.1. Spring boot with Springdoc
47.1.1. WebMvc
47.1.2. Webflux
47.1.3. Swagger UI
47.1.4. 从 SpringFox 迁移到 Swagger3 注解变化
47.2. Spring boot with knife4j
47.2.1. maven
47.2.2. Knife4jConfiguration
47.2.3. application.properties
47.3. springfox
47.3.1. Swagger3
47.3.2. Swagger2
47.3.3. @Api() 资源定义
47.3.4. @ApiIgnore 忽律接口
47.3.5. @ApiOperation()
47.3.6. @ApiResponses
47.3.7. @ApiModel 实体类
48. Spring boot with lombok
48.1. @Builder
48.2. @Slf4j 注解
49. Spring boot with Container
49.1. Spring boot with Docker
49.1.1. 通过 Docker 命令构建镜像
49.1.2. 通过 Maven 构建 Docker 镜像
49.1.3. [ERROR] No plugin found for prefix 'dockerfile' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/neo/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
49.1.4. curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:8888
49.2. Spring boot with Docker stack
49.2.1. 编译 Docker 镜像
49.2.2.
49.3. Spring boot with Kubernetes
49.3.1. Kubernetes 编排脚本
49.3.2. 部署镜像
50. Spring boot with command line
50.1. Maven
50.2. CommandLineRunner 例子
50.3. ApplicationRunner 例子
51. Spring Boot Actuator
51.1. Maven 依赖
51.2. 与 Spring Boot Actuator 有关的配置
51.2.1. 禁用HTTP端点
51.2.2. 安全配置
51.2.3. 修改 actuator 地址
51.2.4. 关机
51.3. actuator 接口
51.4. 健康状态
51.4.1. 健康状态
51.5. info 配置信息
51.6. beans 信息
51.7. caches
51.8. conditions
51.9. configprops 配置文件
51.10. env 环境变量
51.11. logfile 日志
51.12. threaddump 线程信息
51.13. 计划任务
51.14. metrics
51.15. 控制器映射 URL
51.16. 自定义监控指标
52. SpringBootTest
52.1. Maven 依赖
52.2. 测试类
52.2.1. Junit基本注解介绍
52.3.
52.3.1. Assert.assertEquals 判断相等
52.3.2. Assert.assertTrue
52.4. JPA 测试
52.5. TestRestTemplate
52.6. Controller单元测试
52.7. WebTestClient
53. Spring boot with Aop
53.1. Aspect
53.1.1. Maven
53.1.2. Pojo 类
53.1.3. Service 类
53.1.4. Aspect 类
53.1.5. 控制器
53.1.6. Application
53.1.7. 测试
54. Spring boot with starter
54.1. 实现 starter
54.1.1. Maven pom.xml 依赖包
54.1.2. 配置文件处理
54.1.3. 自动配置文件
54.1.4. 启用 starter 的自定义注解
54.2. 引用 starter
54.2.1. Maven pom.xml 引入依赖
54.2.2. 通过注解配置 starter
54.2.3. 测试运行结果
55. Spring boot with Monitor
55.1. Spring boot with Grafana
55.1.1. Springboot 集成 InfluxDB
55.1.2. InfluxDB
55.2. Spring Boot with Prometheus
55.2.1. Maven 依赖
55.2.2. application.properties 配置文件
55.2.3. 启动类
55.2.4. 测试
55.2.5. 控制器监控
55.2.6. 自定义埋点监控
57. Spring boot with Git version
57.1. CommonRestController 公共控制器
57.2. VersionRestController 测试控制器
57.3. 创建 .gitattributes 文件
58. Spring boot with Session share
58.1. Redis
58.1.1. Maven
58.1.2. application.properties
58.1.3. Application
58.2. 测试 Session
58.3. JDBC
58.4. Springboot 2.1
59. Spring boot with Caching
59.1. maven
59.1.1. Redis
59.2. 启用缓存 @EnableCaching
59.3. 设置缓存 @Cacheable
59.3.1. 多参数处理
59.3.2. 对象参数
59.3.3.
59.3.4. 参数索引
59.3.5. 自动生成 key
59.3.6. SpEL表达式
59.3.7. 排除 null 结果
59.3.8. 排除 empty
59.4. 更新缓存 @CachePut
59.5. 删除缓存 @CacheEvict
59.6. 组合操作 @Caching
59.7. 解决Expire 和 TTL 过期时间
59.8. Cannot serialize
60. Spring boot with Email
60.1. Maven
60.2. Resource
60.3. POJO
60.4. RestController
60.5. Test
61. Spring boot with Hessian
61.1. Maven
61.2. Application
61.3. HessianServiceExporter
61.4. Service
61.5. RestController
62. Spring boot with Async
62.1. Callable 实现异步
62.2. WebAsyncTask 实现异步
62.3. DeferredResult 实现异步返回结果
62.4. 带有返回值的异步任务
62.4.1. Future
62.4.2. CompletableFuture
62.5. 默认简单线程池 SimpleAsyncTaskExecutor
62.5.1. 配置线程池
62.5.2. @Service/@Component 中异步执行
62.5.3. applicationTaskExecutor
62.6. ThreadPoolTaskExecutor 自定义线程池
62.6.1. 最简单的配置
62.6.2. 队列
62.6.3. 定义多个线程池
62.6.4. 实现 AsyncConfigurer 接口方式创建自定义连接池
62.6.5. 继承 AsyncConfigurerSupport 创建自定义连接池
62.6.6. 生产环境完整代码 @Bean 注入方式
62.6.7. 通过 @Bean 覆盖掉 SimpleAsyncTaskExecutor
62.7. 自定义线程池 ThreadPoolExecutor
62.7.1. ThreadPoolExecutor
62.7.2. 注入自定义线程池bean
62.8. 设置线程名称
62.9. 线程池监控
62.10. 注意事项
63. Springboot with Ethereum (web3j)
63.1. Maven
63.2. application.properties
63.3. TestRestController
63.4. 测试
64. Java Record 新特性
64.1. Record 替代 POJO 类
64.2. Record 作为 Properties
64.3. Record 作为实体类
64.4. Record 作为 Service
64.5. Record 作为 Controller
V. Spring Framework
65. Spring 框架
65.1. @Bean
65.1.1. @Scope 定义类型
65.1.2. InitializingBean
65.2. URL 拼装/解析
65.3. ServletUriComponentsBuilder
65.4. URL 路径相关
66. Spring MVC
66.1. @EnableWebMvc
66.1.1. CORS 跨域请求
66.1.2. Spring MVC CORS with WebMvcConfigurerAdapter
66.2. @Controller
66.2.1. @RequestMapping
66.2.2. @GetMapping
66.2.3. @PostMapping
66.2.4. @RequestBody
66.2.5. RequestMapping with Request Parameters - @RequestParam
66.2.6. @RequestHeader - 获取 HTTP Header 信息
66.2.7. RequestMapping with Path Variables - @PathVariable
66.2.8. @MatrixVariable注解,RFC3986定义URI的路径(Path)中可包含name-value片段
66.2.9. @ModelAttribute
66.2.10. @ResponseBody
66.2.11. @ResponseStatus 设置 HTTP 状态
66.2.12. @CrossOrigin
66.2.13. @CookieValue - 获取 Cookie 值
66.2.14. @SessionAttributes
66.2.15. ModelAndView
66.2.16. HttpServletResponse
66.2.17. HttpServletRequest
66.3. @RestController
66.3.1. 接口设计中 URL 参数,FORM 参数,JSON 怎么选择
66.3.2. 返回迭代器
66.3.3. 上传文件
66.3.4. 返回实体
66.3.5. JSON
66.3.6. 处理原始 RAW JSON 数据
66.3.7. 返回 JSON 对象 NULL 专为 "" 字符串
66.3.8. XML
66.3.9. 兼容传统 json 接口
66.3.10. 上传文件
66.3.11. 下载文件
66.3.12. Mime/MediaType
66.3.13. Spring boot with csv
66.3.14. Json 处理
66.3.15. synchronized
66.3.16. Spring boot with Emitter
66.3.17. forward 转发
66.4. View
66.4.1. 配置静态文件目录
66.4.2. 添加静态文件目录
66.4.3. Using Spring’s form tag library
66.4.4. Thymeleaf
66.4.5. FreeMarker
66.4.6. i18n 国际化
66.5. Spring boot with Webpage
66.5.1. Maven
66.5.2. application.properties
66.5.3. Application
66.5.4. IndexController
66.5.5. src/main/webapp/WEB-INF/jsp/index.jsp
66.5.6. 集成模板引擎
66.6. Spring boot with Velocity template
66.6.1. Maven
66.6.2. Resource
66.6.3. Application
66.6.4. RestController
66.6.5. Test
66.7. Spring boot with Thymeleaf
66.7.1. Maven
66.7.2. application.properties
66.7.3. Controller
66.7.4. HTML5 Template
66.8. 校验器(Validator)
66.8.1. 常规用法
66.8.2. 自定义注解
66.9. Interceptor/Filter 拦截器/过滤
66.9.1. Session 拦截
66.9.2. Token 拦截
66.9.3. Authorization Bearer
66.9.4. 过滤器
66.9.5. 拦截器获取PathVariable变量
66.10. String boot with RestTemplate
66.10.1. RestTemplate Example
66.10.2. GET 操作
66.10.3. POST 操作
66.10.4. PUT 操作
66.10.5. Delete 操作
66.10.6. 上传文件
66.10.7. HTTP Auth
66.10.8. PKCS12
66.10.9. Timeout 超时设置
66.11. RestClient
66.11.1. 创建 RestClient
66.11.2. Get 操作
66.11.3. Post Json
66.11.4. HTTP Authorization Basic
66.11.5. onStatus
66.11.6. Timeout 超时设置
66.11.7. 下载二进制流
66.11.8. 上传文件
68. WebFlux framework
68.1. Getting Started
68.1.1. Maven
68.1.2. Application
68.1.3. RestController
68.1.4. 测试
68.2. WebFlux 与 SprintMVC 有什么不同?
68.2.1. 实验程序
68.2.2. 实验结果
68.3. WebFlux Router
68.3.1. Component 原件
68.3.2. 路由配置
68.4. RestController
68.4.1. Post 数据
68.4.2. Thymeleaf
68.5. Webflux Redis
68.5.1. Maven Redis 依赖
68.5.2. Redis 配置
68.5.3. Config
68.5.4. Service
68.5.5.
68.6. Webflux Mongdb
68.6.1. Maven 依赖
68.6.2. Repository
68.6.3. Service
68.6.4. 控制器
68.7. Mono
68.7.1. Mono.just()/Mono.justOrEmpty()
68.7.2. MonoSink 创建 Mono
68.7.3. Supplier 创建 Mono
68.7.4. then()
68.7.5. 异常处理
68.7.6. 同步阻塞等待结果
68.8. Flux 返回多条数据
68.8.1. FluxSink 创建异步 Flux
68.8.2. SynchronousSink 创建同步 Flux
68.8.3. just()
68.8.4. 从 Flux/Mono 创建 Flux
68.8.5. 消息订阅
68.8.6. 从 Flux/Mono 创建 Flux
68.8.7. 从 Iterable 创建 Flux
68.8.8. 从 Stream 创建 Flux
68.8.9. defer()
68.8.10. Flux.interval()
68.8.11. Flux.empty()
68.8.12. Flux.error()
68.8.13. Flux.never()
68.8.14. Flux.range()
68.8.15. 返回数据
68.8.16. 持续更新 Flux
68.8.17. map(), flatMap()
68.8.18. 过滤
68.8.19. 触发操作
68.9. SSE
68.9.1. 一次性事件
68.9.2. 从 Steam 返回数据
68.9.3. 周期性事件
68.9.4. 返回 ServerSentEvent 数据结构
68.9.5. SSE 完整的例子
68.9.6. SSE Client 订阅实例
68.10. 并发
68.11. ConnectableFlux
68.12. 末尾连接字符串
68.12.1. concatWith
68.12.2. concatWithValues
68.13. Flux scan
68.14. WebClient
68.14.1. 配置 WebClient
68.14.2. @Controller/@RestController 实例
68.14.3. Get 请求实例
68.14.4. URI 参数
68.14.5. 查询参数
68.14.6. Post 操作演示
68.14.7. Post 表单数据
68.14.8. 上传文件
68.14.9. 设置 HTTP 头
68.14.10. 同步阻塞等待返回结果
68.14.11. websocket
68.14.12. 获取 HTTP 链接状态
68.14.13. Http Base Authentication - 401 Unauthorized
68.14.14. SSE(Server-Sent Events)
68.14.15. 超时时间
68.14.16. share() 共享订阅数据
68.14.17. 打印调试日志
68.14.18. 解决 WebClient 截断 URI的问题
68.14.19. 异常处理
68.15. Webflux 安全
68.15.1. Token 拦截器
68.15.2. JWT
68.15.3. spring-boot-starter-security
68.16. 常见问题
68.16.1. The Java/XML config for Spring MVC and Spring WebFlux cannot both be enabled, e.g. via @EnableWebMvc and @EnableWebFlux, in the same application.
68.16.2. @EnableWebFluxSecurity 与 @EnableReactiveMethodSecurity 不生效
68.16.3. webflux netty 不支持 Content-Type: application/x-www-form-urlencoded
69. Service
69.1. Application
69.2. 定义接口
69.3. 实现接口
69.4. 调用 Service
69.5. context.getBean 调用 Service
69.6. AopContext
69.7. Service 单例/多例模式
69.7.1. Service 是单例模式
69.7.2. Service 多例实现
69.8. 构造方法
70. Tomcat Spring 运行环境
70.1. Maven
70.2. Spring MVC configuration
70.3. Tomcat
70.4. 集成 Mybatis
70.4.1. pom.xml
70.4.2. properties
70.4.3. dataSource
70.4.4. SqlSessionFactory
70.4.5. Mapper 扫描
70.4.6. Mapper 单一class映射
70.4.7. Service
70.4.8. 测试实例
VI. Spring Data
71. EntityManager
72. Spring Data with JdbcTemplate
72.1. execute
72.2. queryForInt
72.3. queryForLong
72.4. queryForObject
72.4.1. 返回整形与字符型
72.4.2. 查询 Double 类型数据库
72.4.3. 返回日期
72.4.4. 返回结果集
72.4.5. 通过 "?" 向SQL传递参数
72.4.6. RowMapper 记录映射
72.5. queryForList
72.5.1. Iterator 用法
72.5.2. for 循环
72.5.3. forEach 用法
72.6. queryForMap
72.7. query
72.7.1. ResultSet
72.7.2. ResultSetExtractor
72.7.3. RowMapper
72.8. queryForRowSet
72.9. update
72.10. MapSqlParameterSource
72.11. 实例参考
72.11.1. 参数传递技巧
73. Spring Data with MySQL
73.1. 选择数据库表引擎
73.2. 声明实体
73.2.1. @Entity 声明实体
73.2.2. @Table 定义表名
73.2.3. @Id 定义主键
73.2.4. @Column 定义字段:
73.2.5. 非数据库字段
73.2.6. @Lob 注解属性将被持久化为 Blog 或 Clob 类型
73.2.7. @NotNull 不能为空声明
73.2.8. @Temporal 日期定义
73.2.9. 创建日期
73.2.10. @DateTimeFormat 处理日期时间格式
73.2.11. Enum 枚举数据类型
73.2.12. SET 数据结构
73.2.13. JSON 数据类型
73.2.14. 嵌入
73.2.15. @JsonIgnore
73.2.16. @EnableJpaAuditing 开启 JPA 审计功能
73.2.17. 注释 @Comment
73.2.18. @Pattern 数据匹配
73.2.19. 实体继承
73.3. 映射集合属性
73.3.1. List 集合
73.3.2. 数组集合
73.3.3. Map 集合
73.3.4. Set 集合
73.3.5. 外键名称
73.3.6. 集合表子查询
73.4. 外键
73.4.1. @JoinColumn
73.4.2. @OneToOne
73.4.3. OneToMany 一对多
73.4.4. ManyToMany 多对多
73.4.5. 外键级联删除
73.4.6. 外键级联操作
73.4.7. @JoinTable
73.4.8. @OrderBy
73.4.9. @JsonIgnoreProperties
73.4.10. 允许外键为 NULL
73.4.11. 只要外键,不要数据结构
73.5. 索引
73.5.1. 普通索引
73.5.2. 组合索引
73.5.3. 唯一索引
73.6. Repository
73.6.1. JpaRepository
73.6.2. CrudRepository
73.6.3. PagingAndSortingRepository
73.6.4. findByXXX
73.6.5. count 操作
73.6.6. delete 删除操作
73.6.7. IsNull
73.6.8. In/NotIn
73.6.9. TRUE / FALSE
73.6.10. Before/After
73.6.11. Between
73.6.12. Exists
73.6.13. OrderBy
73.6.14. GreaterThan
73.6.15. Sort 排序操作操作
73.6.16. Pageable 翻页操作
73.6.17. @DynamicInsert 与 @DynamicUpdate
73.6.18. 继承已存在的 Repository
73.6.19. 自定义返回字段
73.6.20. Optional
73.7. TransactionTemplate
73.8. JPQL @Query
73.8.1. @Modifying 更新/删除
73.8.2. 参数传递
73.8.3. 原生 SQL 操作
73.8.4. @Query 与 Pageagble
73.8.5. 返回指定字段
73.8.6. 返回指定的模型
73.8.7. 通过定义接口,返回指定字段
73.8.8. 修改返回数据
73.8.9. 事务 @Transactional
73.8.10. IN / NOT 子查询
73.9. FAQ 常见问题
73.9.1. Could not write JSON: failed to lazily initialize a collection of role
73.9.2. Query did not return a unique result: 2 results were returned
73.9.3. Executing an update/delete query
73.9.4. could not initialize proxy [cn.netkiller.domain.Device#16] - no Session
73.9.5. this is incompatible with sql_mode=only_full_group_by
73.9.6. A TupleBackedMap cannot be modified
74. Spring Data with Redis
74.1. 集成 Redis XML 方式
74.1.1. pom.xml
74.1.2. springframework-servlet.xml
74.1.3. Controller
74.1.4. index.jsp
74.1.5. 测试
74.2. 通过构造方法实例化 Redis
74.3. StringRedisTemplate 基本用法
74.3.1. 存储数据
74.3.2. 获取值并删除
74.3.3. 取出数据
74.4. RedisTemplate
74.4.1. 设置缓存时间
74.4.2. increment
74.4.3. 删除 key
74.4.4. 对象存储
74.4.5. 获取过期时间
74.4.6. 过期时间未执行
74.5. ValueOperations
74.5.1. 字符串截取
74.5.2. 追加字符串
74.5.3. 设置键的字符串值并返回其旧值
74.5.4. 返回字符串长度
74.5.5. 如果key不存便缓存。
74.5.6. 缓存多个值 /获取多个值 multiSet / multiGet
74.5.7. setBit / getBit 二进制位操作
74.6. 列表操作
74.6.1. rightPush
74.6.2. rightPushAll
74.6.3. rightPushIfPresent
74.6.4. leftPush
74.6.5. leftPushAll
74.6.6. range
74.7. SetOperations 数据类型
74.7.1. 返回集合中的所有成员
74.7.2. 取出一个成员
74.7.3. 随机获取无序集合中的一个元素
74.7.4. 随机获取 n 个成员(存在重复数据)
74.7.5. 随机获取 n 个不重复成员
74.7.6. 在两个 SET 间移动数据
74.7.7. 成员删除
74.7.8. 返回集合数量
74.7.9. 判断元素是否在集合成员中
74.7.10. 对比两个集合求交集
74.7.11. 对比两个集合求交集,然后存储到新的 key 中
74.7.12. 合并两个集合,并去处重复数据
74.7.13. 合并两个集合去重复后保存到新的 key 中
74.7.14. 计算两个合集的差集
74.7.15. 计算两个合集的差集,然后保存到新的 key 中
74.7.16. 遍历 SET 集合
74.8. ZSetOperations 有序的 set 集合
74.9. HashOperations
74.9.1. put
74.9.2. putAll
74.9.3. 从键中的哈希获取给定hashKey的值
74.9.4. delete
74.9.5. 确定哈希hashKey是否存在
74.9.6. 从哈希中获取指定的多个 hashKey 的值
74.9.7. 只有hashKey不存在时才能添加值
74.9.8. 获取整个Hash
74.9.9. 获取所有key
74.9.10. 通过 hashKey 获取所有值
74.9.11. 值加法操作
74.9.12. 遍历 Hash 表
74.10. 存储 Json 对象
74.10.1. 集成 RedisTemplate 定义新类 JsonRedisTemplate
74.10.2. 配置 Redis
74.10.3. 测试
74.11. Spring Data Redis - Repository Examples
74.11.1. @EnableRedisRepositories 启动 Redis 仓库
74.11.2. 定义 Domain 类
74.11.3. Repository 接口
74.11.4. 测试代码
74.12. CacheService
74.13. FAQ
74.13.1. Spring Data Redis
75. Spring Data with MongoDB
75.1. Example Spring Data MongoDB
75.1.1. pom.xml
75.1.2. springframework-servlet.xml
75.1.3. POJO
75.1.4. Controller
75.1.5. 查看测试结果
75.1.6. 条件查询
75.2. MongoDB 多数据源
75.2.1. Maven
75.2.2. Application 禁止自动配置 MongoDB
75.2.3. application.properties 新增配置项
75.2.4. MongoDB 配置类
75.2.5. 创建 Document 关系映射类
75.2.6. 测试控制器
75.2.7. 测试
75.3. @Document
75.3.1. 指定表名
75.3.2. @Id
75.3.3. @Version
75.3.4. @Field 定义字段名
75.3.5. @Indexed
75.3.6. @CompoundIndex 复合索引
75.3.7. @TextIndexed
75.3.8. @GeoSpatialIndex 地理位置索引
75.3.9. @Transient 丢弃数据,不存到 mongodb
75.3.10. @DBRef 做外外键引用
75.3.11. @DateTimeFormat
75.3.12. @NumberFormat
75.3.13. 在 @Document 中使用 Enum 类型
75.3.14. 在 @Document 中定义数据结构 List/Map
75.3.15. GeoJson 数据类型
75.4. MongoRepository
75.4.1. 扫描仓库接口
75.4.2. findAll()
75.4.3. deleteAll()
75.4.4. save()
75.4.5. count()
75.4.6. exists() 判断是否存在
75.4.7. existsById()
75.4.8. findByXXXX
75.4.9. findAll with OrderBy
75.4.10. findAll with Sort
75.4.11. FindAll with Pageable
75.4.12. StartingWith 和 EndingWith
75.4.13. Between
75.4.14. Before / After
75.4.15. @Query
75.5. mongoTemplate
75.5.1. Save 保存
75.5.2. Insert
75.5.3. updateFirst 修改符合条件第一条记录
75.5.4. updateMulti 修改符合条件的所有
75.5.5. 查找并保存
75.5.6. upsert - 修改符合条件时如果不存在则添加
75.5.7. 删除
75.5.8. 查找一条数据
75.5.9. 查找所有数据
75.5.10. Query
75.5.11. Criteria
75.5.12. Update
75.5.13. BasicUpdate
75.5.14. Sort
75.5.15. Query + PageRequest
75.5.16. newAggregation
75.5.17. 创建索引
75.5.18. 子对象操作
75.6. GeoJson 反序列化
75.7. FAQ
75.7.1. location object expected, location array not in correct format; nested exception is com.mongodb.MongoWriteException: location object expected, location array not in correct format
76. Spring Data with Elasticsearch
76.1. 内嵌 Elasticsearch
76.1.1. Maven
76.1.2. src/main/resources/application.properties
76.1.3. Domain Class
76.1.4. ElasticsearchRepository
76.1.5. SearchRestController
76.1.6. 测试
76.2. 集群模式
76.3. Document
76.4. Elasticsearch 删除操作
76.5. FAQ
76.5.1. java.lang.IllegalStateException: Received message from unsupported version: [2.0.0] minimal compatible version is: [5.0.0]
77. Spring boot with Data restful
77.1. Maven
78. Apache ShardingSphere
78.1. 微服务集群环境,雪花算法出现重复ID
78.1.1. 方案一、配置实现
78.1.2. 方案二、代码实现
VII. Spring Security
79. Springboot 3 + Security 6
79.1. Spring Security with HTTP Auth
79.1.1. 默认配置
79.1.2. 设置用户名和密码
79.1.3. 禁用 Security
79.1.4. 设置角色
79.2. Springboot 3 Security + OncePerRequestFilter
79.2.1. OncePerRequestFilter
79.2.2. SecurityConfiguration
79.3. SecurityFilterChain
79.4. @PreAuthorize
79.4.1. hasRole
79.4.2. hasAnyRole
79.4.3. 从 HttpServletRequest 返回的 request 变量中判断角色
79.4.4. getAuthentication() 获得角色
79.4.5. UserDetailsService
79.5. httpBasic 配置
79.5.1. 禁止 HTTP Auth
79.6. InvalidClaimException: The Token can't be used before
80. Spring Authorization Server
80.1. Oauth2 协议
80.1.1. token
80.1.2. grant_type
80.1.3. 授权码授权模式(Authorization Code Grant)
80.1.4. 密码模式(Resource Owner Password Credentials Grant)
80.1.5. 客户端凭证模式(Client Credentials Grant)
80.1.6. 刷新 TOKEN 方式
80.2. Maven 依赖
80.3. Spring cloud with Oauth2
80.3.1. authorization_code
80.3.2. Spring boot with Oauth2 - Password
80.3.3. Spring boot with Oauth2 jwt
80.3.4. Spring boot with Oauth2 jwt 非对称证书
80.3.5. Apple iOS 访问 Oauth2
80.3.6. Oauth2 客户端
80.3.7. Android Oauth2 + Jwt example
80.3.8. RestTemplate 使用 HttpClient
80.3.9. 自签名证书信任问题
80.3.10. Principal
80.3.11. SecurityContextHolder 对象
80.3.12. 资源服务器配置
80.3.13. Client
80.3.14. Oauth2 常见问题
81. Spring boot with Spring security(2.x)
81.1. Spring security 静态配置例子
81.1.1. Maven
81.1.2. Reource
81.1.3. Application
81.1.4. WebSecurityConfigurer
81.1.5. RestController
81.1.6. 测试
81.2. Spring + Security + MongoDB
81.2.1. Account
81.2.2. AccountRepository
81.2.3. WebSecurityConfiguration
81.3. Spring Boot with Web Security(2.x)
81.3.1. EnableWebSecurity
81.3.2. Web静态资源
81.3.3. 正则匹配
81.3.4. 登陆页面,失败页面,登陆中页面
81.3.5. CORS
81.3.6. X-Frame-Options 安全
81.4. 访问控制列表(Access Control List,ACL)
81.4.1. antMatchers
81.4.2. HTTP Auth
81.4.3. Rest
81.4.4. hasRole
81.4.5. hasAnyRole()
81.4.6. withUser
VIII. Spring Cloud
82. 云服务
82.1. 讯飞云
82.1.1. AIUI
82.1.2. 讯飞 TTS
82.1.3. 语音唤醒
82.2. 阿里云
82.2.1. nuisdk-release.aar 版本问题
82.2.2. 获取 Token
82.2.3. 语音唤醒
82.2.4. CosyVoice 语音合成
83. Spring Integration
83.1. Spring Redis Lock
83.1.1. Maven 依赖
83.1.2. 配置锁
83.1.3. 使用方法
83.2. MQTT Support
83.2.1. 入站消息通道适配器
83.2.2. 出站通道适配器
83.2.3. @MessagingGateway 定义消息网管接口
83.2.4. 手动 ACK 应答
83.2.5. Spring boot with Mqtt v5
84. MyBatis
84.1. Mybatis 入门
84.2. 接口注解
85. Apache Struts
85.1. struts.xml
85.1.1. include
85.2. Struts Tags
85.2.1. property
85.2.2. set
85.2.3. url
85.2.4. s:include
85.2.5. s:action
85.2.6. HTML Form
85.2.7. iterator
85.2.8. if elseif else
85.3. Action
85.3.1. redirect
85.3.2. redirectAction
85.3.3. JSON
85.3.4. 传递 Timestamp 变量
85.4. Ajax + JSON
85.4.1. GET/POST JSON
85.5. Json 内容展示
85.5.1. 禁止方法
85.5.2. 格式化日期
85.5.3. 重命名变量名
85.5.4. org.apache.struts2.json
85.6. Interceptor
85.6.1. Session
85.7. Action 中使用线程
85.8. 日志
85.9. FAQ
85.9.1. Struts 怎样判断用户来自电脑还是移动设备
86. Apache Tiles
86.1. 配置 Tiles
86.1.1. Maven
86.1.2. web.xml
86.2. Template 配置模板
86.3. Struts tiles
87. Play
88. Servlet
88.1. Example
88.2. Session
88.3. HttpServletRequest
88.4. Filter
88.4.1. web.xml
88.4.2. Filter 类
88.5. Listener
88.5.1. web.xml
88.5.2. NewsListener 类
88.5.3. NewsTask 类
88.5.4. JSP 中心显示
88.6. JSP
88.6.1. 注释
88.6.2. pageContext
88.6.3. request
88.6.4.
88.6.5. cookie
88.6.6. session
88.6.7. page
88.6.8. trimDirectiveWhitespaces
88.6.9. include
88.6.10. jsp
88.6.11. error-page
88.6.12. JSP 编程
88.6.13. FAQ
88.7. JSTL(JavaServer Pages Standard Tag Library)
88.7.1. c:set
88.7.2. c:out
88.7.3. c:url
88.7.4. c:redirect
88.7.5. c:import
88.7.6. c:if
88.7.7. c:choose
88.7.8. c:forEach
88.7.9. empty 判断是否为空
88.7.10. JSTL fmt Tag setBundle Example
88.8. WebSocket
88.8.1. Server
88.8.2. Client
89. Log
89.1. Logback
89.1.1. Maven 包
89.1.2. Example
89.2. slf4j
89.3. log4j
89.3.1. 安装 Log4j
89.3.2. log4j 环境变量
89.3.3. Log4j Example
89.3.4. log4j.properties
90. AMQP(Advanced Message Queuing Protocol)
90.1. Send and Recv
90.2. direct
91. NoSQL
91.1. MongoDB
91.1.1. pom.xml
91.1.2. 插入操作
91.1.3. 读取操作
92. Elasticsearch API
92.1. Client
92.2. insert
92.3. Get
92.4. delete
92.5. Search
92.6. Query 查询
92.6.1. match all 匹配所有数据
92.6.2. match 匹配查询
92.6.3. match phrase 短语精准匹配
92.7. Filter 过滤
92.7.1. term
92.7.2. range
92.8. Sorting
92.9. 返回 Source 字段
92.10. Count
92.11. Example 范例
92.11.1. Spring boot 案例
92.12. FAQ
92.12.1. 显示查询 JSON 字符串
93. Jersey - RESTful Web Services in Java.
93.1. Client 2.x
93.1.1. Maven 版本
93.1.2. GET 操作
93.1.3. GET + Auth 用户认证
93.2. Client 1.x
93.2.1. Jersey + Auth + HTTP2 + SSL
94. Apache HttpComponents
94.1. org.apache.commons.lang3
94.1.1. HTML 标签处理
94.1.2. StringUtils.join 使用特定字符链接字符串
94.1.3. RandomStringUtils
94.2. commons-text
94.2.1. 禁止转译 json
94.3. Apache HttpClient
94.3.1. Maven
94.3.2. HTTP POST 操作
94.3.3. HTTPS
94.3.4. HTTP/2
94.3.5. Java11
94.3.6. Host name 'api.netkiller.cn' does not match the certificate subject provided
94.3.7. HttpStatus
94.3.8.
95. Cache
95.1. java memcached client
95.2. Jedis
95.2.1. 认证
95.2.2. jedis.keys
95.3. Ehcache
96. Kafka
96.1. 安装 Kafka 环境
96.2. Maven
96.3. 启动 kafka
96.4. 入门例子
96.4.1. 订阅例子
96.4.2. 发布例子
96.5. 线程例子
97. Software Development Kit
97.1. JAVE(Java Audio Video Encoder)
97.2. Google
97.2.1. com.google.gson
97.2.2. Guava
97.3. Mahout
97.3.1. 推荐系统
97.4. Hessian
97.5. quartz-scheduler
97.6. Redisson
IX. Android
98. Android Studio
98.1. 卸载 Android Studio
98.2. 代码格式化
98.3. 设置兼容最低SDK版本
98.4. SDK Tools
98.4.1. 接受 License
98.4.2. 查看 SDK 列表
98.4.3. 按照 Android SDK
98.5. 命令行操作
98.6. adb 命令
98.6.1. 获得 root 权限
98.6.2. 设备管理
98.6.3. Shell
98.6.4. 设备 ID
98.6.5. 查看安卓版本
98.6.6. Logcat
98.6.7. 上传文件
98.6.8. 下载文件
98.6.9. 安卓 .apk bk
98.6.10. 屏幕尺寸
98.6.11. dump 系统信息
98.6.12. 解锁
98.6.13. 蓝牙管理
98.6.14. 声卡
98.6.15. 摄像头
99. AndroidManifest.xml
99.1. SDK 版本配置
99.2. 开启网络
99.3. 文件存储权限
99.4. 相机权限
99.5. GPS 定位权限
99.6. 全屏-无标题
99.7. 设置为默认开机启动
99.8. 开机启动
99.9. 默认横屏
99.10. 禁止屏幕旋转变化
100. 设备
100.1. 环境变量
100.1.1. 扩展存储
100.1.2. 下载缓存目录
100.1.3. 数据目录
100.2. 配置文件
100.2.1. *.properties 文件
100.2.2. 再 AndroidManifest.xml 使用 meta-data element 定义
100.2.3. 再 build.gradle 文件中配置 productFlavors
100.2.4. 从 assets 目录读取配置文件
100.3. 设备信息
100.4. Physical density
100.5. 声卡
100.5.1. 播放
100.5.2. 录音
100.5.3. 查看声卡信息
100.5.4. /proc/asound 设备信息
100.5.5. 查看声卡当前占用设备
100.5.6. tinymix 设置声卡参数
100.5.7. 麦克风阵列调试
100.6. 判断是平板,还是手机
100.7. 蓝牙设备管理
100.7.1. 进入蓝牙设置界面
100.7.2. 通过发送广播处理蓝牙
100.7.3. 蓝牙禁用/启用
100.7.4. 获取蓝牙设备
100.7.5. 查询已绑定设备
100.8. USB 设备
100.8.1. USB 音频设备
101. Activity
101.1. 界面佈局
101.1.1. setContentView
101.1.2. 隐藏虚拟键
101.1.3. 保持屏幕常开
101.1.4. 标题栏添加返回按钮
101.2. 切换 Activity
101.2.1. startActivity()
101.2.2. App 间跳转
101.2.3. intentActivityResultLauncher 跳转
101.2.4. startActivityForResult 替代方案
101.3. 生命周期
101.3.1. 定时关闭
101.3.2. 恢复触发
101.3.3. 返回触发
101.3.4. Activity 关闭
101.3.5. 重启自己
101.4. Activity 间数据传递
101.4.1. Intent 方式
101.4.2. Bundle 方式
101.4.3. Flag 属性
101.4.4. 返回值
101.5. DataBinding
101.5.1. 启用 DataBinding
101.5.2. MainActivity 中使用 ActivityMainBinding
101.5.3. ViewDataBinding 例子
101.6. 键盘事件
101.6.1. onKeyDown 键盘按下事件
101.6.2. dispatchKeyEvent
101.6.3. 屏蔽 KeyEvent.KEYCODE_BACK
101.6.4. 判断按下次数
101.7. 鼠标事件
101.8. 分享
101.8.1. 分享文本内容
101.8.2. 分享图片
101.8.3.
101.9. 剪切板
101.10. 软键盘控制
101.11. 自定义事件
101.11.1. 按钮点击事件
101.11.2. OnCheckedChangeListener
101.11.3. CustomOnItemSelectedListener
101.11.4. CustomOnScrollListener
101.11.5. CustomOnTabSelectedListener
101.12. Res 资源
101.12.1. 通过名称查找 layout ID
101.12.2. 查找 drawable 资源 ID
101.12.3. 获取 color 颜色 ID
101.12.4. 获取 array.xml 文件下某个字段的 ID
101.12.5. 获取 style.xml 文件下的某个样式的 id
101.12.6. 主题 themes.xml
102. Fragment
102.1. 启动 Fragment
102.2. 关闭 Fragment
102.3. 在 Fragment 中使用 findViewById
102.4. 在 Fragment 跳转 Activity
102.5. 在 Fragment 跳转 Activity 同时携带 Intent 参数
102.6. Fragment 中调用 getPackageManager()
102.7. 在 Fragment 中使用 runOnUiThread
102.8. Fragment 中调用 findViewById
102.9. 替换 FrameLayout
102.10. Fragment 接收 BroadcastReceiver 广播
102.11. Fragment 加载报错 java.lang.IllegalArgumentException: No view found for id ...
102.12. 使用 TabLayout 切换 Fragment
103. Resources
103.1. strings.xml
103.1.1. 字符串
103.1.2. 定义数组
103.1.3. 获取 Resource
103.1.4. Fragment 获取 Resource
103.2. dimens.xml
104. Palette 视觉设计
104.1. 禁止屏幕休眠
104.2. 颜色设置
104.2.1. 颜色设置
104.3. 样式布局
104.3.1. ConstraintLayout
104.3.2. LinearLayout
104.3.3. FrameLayout
104.3.4. 声音波形图
104.4. UI 界面
104.4.1. Toast
104.4.2. Dialog
104.4.3. DatePicker
104.4.4. Snackbar - Toast 的替代者
104.5. Text
104.5.1. Text 相关属性
104.5.2. TextView
104.5.3. EditText
104.5.4. 光标移动到行尾
104.5.5. 禁止选择文本
104.5.6. 设置 app:backgroundTint
104.5.7. 禁止滚动条
104.6. Button
104.6.1. 启用禁用
104.6.2. 实现 OnClickListener 接口
104.6.3. Fragment 中使用 Button
104.6.4. 圆形按钮
104.6.5. ImageButton
104.6.6. 添加悬浮操作按钮
104.7. Switch
104.8. Widgets
104.8.1. ImageView
104.8.2. TextClock
104.8.3. 进度条
104.8.4. NestedScrollView +
104.9. Containers
104.9.1. CardView
104.9.2. RecyclerView
104.9.3. NavigationView
104.9.4. 底部导航
104.9.5. TabLayout
104.9.6. ViewPager2
104.9.7. Navigation
104.10. 屏幕
104.10.1.
104.10.2. 媒体路由
104.10.3. 分辨率
104.10.4. 尺寸
104.10.5. 全屏显示
104.10.6. 音频处理
104.10.7. 屏幕触摸事件 onTouch(View view, MotionEvent motionEvent)
104.10.8. 手势事件
104.10.9. SimpleOnGestureListener
104.10.10. SimpleOnScaleGestureListener
104.11. 带有小三角指示的消息框
104.11.1. 左侧三角
104.11.2. 右侧三角
104.11.3. 正三角
104.11.4. 倒三角
104.11.5. 文本边框
104.11.6. 布局
105. Schedule 计划任务
105.1. 使用 Runnable 和 Handler 实现定时执行
105.1.1. 循环执行
105.1.2. 延迟执行
105.2. TimerTask 实现循环播放
105.2.1. Time 和 TimerTask 定时刷新
105.2.2. TimerTask 更新 UI
105.3. ScheduledExecutorService
106. Internationalization i18n with Android (国际化)
106.1. 创建国际化文件
106.2. strings.xml 文件
106.3. 翻译语言
106.4. 引用国际化文件
106.5. 切换语言
107. 存储
107.1. 获得存储目录
107.1.1. 用户存储目录
107.1.2. Assets 目录
107.1.3. 公共存储目录
107.1.4. 内部存储
107.1.5. 扩展存储
107.1.6. 文件夹类型
107.2. FileProvider 配置
107.3. SD Card
107.3.1. SD Card 状态
107.3.2. Android 11 申请 sdcard 权限
107.4. 下载管理
107.4.1. 从 URL 下来文件
107.4.2. 安装 APK
107.4.3. 下载后接收广播通知
107.5. android.os.FileUriExposedException
107.6. 下载工具类
108. 网络
108.1. Wifi 配置
108.2. WI-FI 与 蜂窝网络 信号强度检测
108.3. OkHttp - An HTTP & HTTP/2 client for Android and Java applications
108.3.1. Gradle
108.3.2. AndroidManifest.xml 开启网络访问权限
108.3.3. okhttp 默认是 HTTPS 开启 HTTP
108.3.4. 连接池
108.3.5. HttpUrl
108.3.6. GET
108.3.7. POST
108.3.8. HTTP PUT 请求
108.3.9. http header 相关设置
108.3.10. HTTP Base Auth
108.3.11. HttpUrl.Builder 组装 URL 地址参数
108.3.12. Android Activity Example
108.3.13. Android Oauth2 + Jwt example
108.3.14. HTTP/2
108.3.15. 异步更新 UI
108.3.16. SSE 客户端
108.3.17. WebSocket Client
108.3.18. EventListener
108.3.19. 文件下来
108.4. Retrofit - https://github.com/square/retrofit
108.4.1. Gradle 依赖
108.4.2. Authorization 头
109. 相机与相册
109.1. 调用相机
109.1.1. manifest 文件
109.1.2. layout
109.1.3. Activity
109.2. 相机开发
109.2.1. 页面布局
109.2.2. 相机逻辑功能
109.3. LED flash 做手电筒
110. 多媒体开发
110.1. AudioDeviceInfo
110.2. MediaPlayer
110.2.1. 播放Raw下的元数据
110.2.2. 播放assets文件夹中的音乐
110.2.3. 播放互联网音乐
110.2.4. 使用单例模式
110.2.5. 设置速度,快进播放
110.2.6. OPUS
110.3. AudioPlayer
110.4. AudioTrack
110.5. VideoView 开发
110.5.1. 播放网络视频
110.5.2. MediaController 添加翻页事件
110.5.3. 静音播放视频
110.5.4. 更新进度条
110.5.5. 完整的例子
110.5.6. 循环播放
110.5.7. 静音播放
110.6. SoundPool
110.7. 音量控制
110.8. 麦克风
110.8.1. AudioRecord
110.8.2. 远端录音
110.8.3. 选择麦克风
110.8.4. 设置蓝牙麦克风为默认麦克风
110.8.5. 录音例子
110.8.6. Microphone 录音,蓝牙,增益
110.9. 麦克风与录音例子
110.9.1. 开启麦克风和SD卡权限
110.9.2. layout
110.9.3. Activity
110.10. MediaRecorder 录音例子
110.11. MediaCodec
110.12. ExoPlayer
110.12.1. Opus
110.13. Opus
111. 定位
111.1. GPS + 网络 定位
111.1.1. manifest 权限配置
111.1.2. layout
111.1.3. Activity
111.2. 只从 GPS 获取定位
112. 电话
112.1. SIM 卡状态
112.2. 通信录与拨打电话
112.3. 发送短信
113. 消息广播
113.1. 动态注册
113.2. 静态注册
113.2.1. 电源管理
113.2.2. 接收不到消息
113.2.3. StaticBroadcastReceiver 完整的例子
113.3. 自定义用户消息广播
113.4. 本地广播
113.5. 动态监听广播
113.6. 广播重复接收
113.7. 指定静态广播接收者
113.8. 异步执行广播
113.9. 静态广播接收不到信息
113.10. 接受蓝牙广播
113.11. 接收 USB 设备广播
113.11.1.
113.12. Wifi 广播
113.13. LiveDataBus - 官方 AndroidX jetpack
114. Service 服务
114.1. Service的基本用法
114.1.1. manifest 文件
114.1.2. 创建 Service
114.1.3. Layout 代码
114.1.4. Activity 代码
114.2. bindService
114.3. Service 中启动线程
114.4. Service 和 Activity 通信
114.4.1. Layout
114.4.2. Service
114.4.3. Activity
114.5. Service 和 Toast
114.6. Service 中启动 Activity
114.7. Service 中更新 UI
114.8. 前台启动 Service
114.9. 在 Fragment 中启动 Service
115. Android 多线程
115.1. Thread
115.1.1. 线程名称
115.1.2. 线程名称
115.1.3. Sleep
115.2. Handler
115.3. HandlerThread
115.3.1. Handler post
115.3.2. 发送消息
115.3.3. 完整例子
115.3.4. 获取线程名称
115.3.5. HandlerThread 队列
115.3.6. Token 应用
115.4. 消息队列
115.4.1. 非阻塞队列 ConcurrentLinkedQueue
116. Notification 通知中心
116.1. 文本通知
116.2. 添加点击操作
116.3. Notification 给 Activity 传值
116.4. 通过 isNotification 判断是否需要执行 onStop() 和 onDestroy()
117. NFC (Near field communication)
117.1. AndroidManifest.xml 文件配置
117.2. Loyout 文件
117.3. Activity 文件
118. 图形开发
118.1. Paint
118.1.1. Paint.setTextSize() SP to PX
118.2. AnimationDrawable
118.3. 矩形
118.4. 路径
119. EventBus
119.1. 添加 EventBus 依赖到项目Gradle文件
119.2. 快速开始一个演示例子
119.2.1. 创建 MessageEvent 类
119.2.2. Layout
119.2.3. Activity
119.3. Sticky Events
119.3.1. MainActivity
119.3.2. StickyActivity
119.3.3. MessageEvent
119.3.4. 删除粘性事件
119.4. 线程模型
119.5. 配置 EventBus
119.6. 事件优先级
119.7. 捕获异常事件
120. Android MQTT
120.1. build.gradle 添加依赖包
120.2. AndroidManifest.xml
120.3. Android Mqtt v5 例子
121. 数据库
121.1. SharedPreferences
121.1.1. 操作模式
121.1.2. 保存数据
121.1.3. 读取数据
121.1.4. 通过 key 查询数据是否存在
121.1.5. 删除数据
121.1.6. 清空数据
121.1.7. 对象存储
121.1.8. SharedPreferences 读取物理存储文件
121.2. Room
121.2.1. 快速开始并掌握 Room 数据库
121.2.2. 组合唯一索引
121.3. Preferences DataStore
121.4. Proto DataStore
122. 杂项
122.1. Caused by: java.net.UnknownServiceException: CLEARTEXT communication to 47.100.253.187 not permitted by network security policy
122.2. 设计模式
122.2.1. 单例模式
122.3. Android OS 包
122.3.1. 进程ID
122.3.2. handler
122.4. fastjson android
122.4.1. 对象转字符串
122.4.2. JsonObject 转对象
122.4.3. 字符串 与 json 互转
122.4.4. json 转 数组
122.4.5. JSON数组转List
122.4.6. Map 与 Json 互转
122.5. Butter Knife
122.6. Android Things
122.6.1. GPIO
123. FAQ
123.1. java.net.UnknownServiceException: CLEARTEXT communication to 192.168.0.185 not permitted by network security policy
123.2. Caused by: android.os.NetworkOnMainThreadException
123.3. java.lang.IllegalStateException: Player is accessed on the wrong thread.
123.4. Manifest merger failed with multiple errors, see logs
123.5. android.os.NetworkOnMainThreadException
123.6. package does not have vibrate permission
123.7. Can't create handler inside thread Thread[...,5,main] that has not called Looper.prepare()
123.8. java.lang.SecurityException: Permission denied (missing INTERNET permission?)
123.9. java.io.IOException: Cleartext HTTP traffic to **** not permitted
123.10. 调试技巧,找不到哪里调用
124. 从 Java 到 Kotlin
124.1. 数据类型与数据结构
124.1.1. 字符串
124.1.2. 日期时间
124.1.3. 数组
124.1.4. List 列表
124.1.5. Map 图
124.1.6. let
124.2. Class
124.2.1. 枚举
124.3. 流程控制
124.3.1.
124.3.2. 循环
124.4. Callback 回调
124.4.1. Consumer
124.4.2. callback
124.4.3. 定义接口方式
124.5. 界面操作
124.5.1. findViewById
124.5.2. runOnUiThread
124.5.3. Fragment
124.5.4. ImageView
124.6. Thread
124.6.1. Handler
124.6.2.
124.7. 定时与延迟执行
124.7.1. Timer
124.7.2.
124.8. MutableLiveData
124.8.1. MutableLiveData 使用 Pair 传 key, value 两个值
124.8.2. MutableLiveData 传自定义对象
124.9. Flow
124.9.1. MutableSharedFlow
124.10. 协程
124.10.1. GlobalScope
124.10.2. MainScope
124.10.3. lifecycleScope
124.10.4.
124.10.5. viewModelScope
124.10.6. 协程上下文与继承关系
125. 云服务
125.1. 讯飞云
125.1.1. AIUI
125.1.2. 讯飞 TTS
125.1.3. 语音唤醒
125.2. 阿里云
125.2.1. nuisdk-release.aar 版本问题
125.2.2. 获取 Token
125.2.3. 语音唤醒
125.2.4. CosyVoice 语音合成
1. 附录
1.1. 一致性算法

范例清单

1.1. /etc/profile.d/java.sh
23.1. Maven properties
23.2. 将本地 lib/*.jar 包添加到项目中
23.3. 将本地 src/resources 打包到项目
23.4. Maven parent
23.5. watir-webdriver example
37.1. Example Spring boot with Oracle
8. RedisTemplate
45.1. Spring boot with Apache kafka.
45.2. Spring boot with Apache kafka.
45.3. Test Spring Kafka
60.1. Spring boot with Email (pom.xml)
66.1. Spring boot with Velocity template (pom.xml)
70.1. MyBatis
74.1. Spring Data Redis Example
75.1. Spring Data MongoDB - springframework-servlet.xml
95.1. memcached.java
105.1.