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

Netkiller Java 手札(2026版)

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

Mr. Neo Chan, 陈景峰(BG7NYT)



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


文档始创于 2015-11-10

电子书最近一次更新于 2026-07-07 11:07:35

版权声明

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

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. Rocky Linux 9 / Almalinux 9 + Maven + OpenJDK25
1.2. Java 21
1.3. Almalinux / RockyLinux
1.4. CentOS 8 Java 14
1.5. Java 版本切换
1.6. 安装 Java 6
1.6.1. HeapDumpOnOutOfMemoryError
1.7. java-1.8.0-openjdk
1.8. docker 环境
1.9. java - Launches a Java application.
1.9.1. java 9~11
1.9.2. -verbose:class 显示载入jar文件
1.9.3. java.io.tmpdir
1.9.4. 显示版本号
1.9.5. 列出java模块
1.10. Java 相关命令
1.10.1. jps
1.10.2. jar
1.10.3. jdeps - Java class dependency analyzer.
1.10.4. JShell
1.10.5. jlink
2. exec 运行shell
2.1. System
2.1.1. System
2.1.2. System.in 标准输入(Stdin)
2.1.3. ANSI Color
2.2. Java 嵌入 Python 代码
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. Duration
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.3.4. 安装终止一个线程
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. NavigableMap
8.7.5. 遍历数据
8.7.6. 迭代器
8.7.7. Map forEach
8.7.8. 随机取值
8.7.9. 有序 Key 值,HashMap 与 LinkedHashMap 对比
8.7.10. 调换 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.10.1. StructuredTaskScope Example
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 虚拟线程(协程)
10.14.1. 与 Future 配合使用
10.14.2. 虚拟线程并发控制
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 应用场景
12.7. Map + Function
12.8. Predicate + Stream
12.9. Enum + Function
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.1.5. 临时文件
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.9.5. Files.delete
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地址何机器名
16.5. HttpClient HTTP/3 (QUIC协议)
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. Rocky Linux 9 + Maven 3.3.9 + OpenJDK25
23.1.2. CentOS 8 安装 Maven
23.1.3. Ubuntu
23.1.4. 一键安装
23.1.5. apache-maven-3.8.2
23.1.6. Nexus Repository OSS
23.1.7. MacOS
23.1.8. 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. Springboot with Undertow / Jetty / http2
32.1. Spring boot with Undertow
32.1.1. Maven 依赖
32.1.2. Application
32.1.3. 相关配置
32.2. Spring boot with Jetty
32.3. Spring boot with HTTP2 SSL
32.3.1. 生成自签名证书
32.3.2. application.properties 配置文件
32.3.3. 启动 Spring boot
32.3.4. restTemplate 调用实例
32.3.5. HTTP2
33. Spring boot with MongoDB
33.1. Maven
33.2. Application
33.3. MongoTemplate
33.4. Repository
34. Spring boot with MySQL
34.1. Maven
34.2. Resource
34.3. Application
34.4. JdbcTemplate
34.5. CrudRepository
35. Spring boot with Oracle
35.1. Maven
35.2. application.properties
35.3. Application
35.4. CrudRepository
35.5. JdbcTemplate
35.6. Controller
36. Spring boot with PostgreSQL
36.1. pom.xml
36.2. application.properties
36.3. Application
36.4. CrudRepository
36.5. JdbcTemplate
36.6. Controller
36.7. Test
37. Spring boot with Elasticsearch
37.1. Maven
37.2. Application
37.3. application.properties
37.4. Domain
37.5. ElasticsearchRepository
38. Spring boot with Elasticsearch TransportClient
38.1. Maven
38.2. Application
38.3. application.properties
38.4. ElasticsearchConfiguration
38.5. RestController
39. Spring boot with Apache Hive
39.1. Maven
39.2. application.properties
39.3. Configuration
39.4. CURD 操作实例
40. Spring boot with Phoenix
40.1. Maven
40.2. application.properties
40.3. Configuration
41. Spring boot with Datasource
41.1. Master / Slave 主从数据库数据源配置
41.1.1. application.properties
41.1.2. 配置主从数据源
41.1.3. 选择数据源
41.2. 多数据源配置
41.3. JPA 多数据源
42. 连接池配置
42.1. org.apache.tomcat.jdbc.pool.DataSource
42.2. druid
42.2.1. 加密数据库密码
42.3. c3p0 - JDBC3 Connection and Statement Pooling
42.4. dbcp2
42.5. bonecp
42.6. HikariPool
43. Spring boot with Queue
43.1. Spring boot with RabbitMQ(AMQP)
43.1.1. maven
43.1.2. RabbitMQConfig
43.1.3. 生产者
43.1.4. 消费者
43.2. Spring boot with Apache Kafka
43.2.1. 安装 kafka
43.2.2. maven
43.2.3. Spring boot Application
43.2.4. EnableKafka
43.2.5. KafkaListener
43.2.6. 测试
43.2.7. 完整的发布订阅实例
43.2.8. Spring cloud with Kafka
44. Spring boot with Scheduling
44.1. 启用计划任务
44.1.1. Application.java
44.1.2. 配置
44.1.3. Component
44.2. 计划任务控制开关
44.3. @Scheduled 详解
44.3.1. fixedRate 案例
44.3.2. timeUnit
44.4. cron 表达式
44.4.1. 每3秒钟一运行一次
44.4.2. 凌晨23点运行
44.4.3. 周一 ~ 周五
44.5. Timer 例子
44.6. ScheduledExecutorService 例子
45. Spring boot with Swagger
45.1. Spring boot with Springdoc
45.1.1. WebMvc
45.1.2. Webflux
45.1.3. Swagger UI
45.1.4. 从 SpringFox 迁移到 Swagger3 注解变化
45.2. Spring boot with knife4j
45.2.1. maven
45.2.2. Knife4jConfiguration
45.2.3. application.properties
45.3. springfox
45.3.1. Swagger3
45.3.2. Swagger2
45.3.3. @Api() 资源定义
45.3.4. @ApiIgnore 忽律接口
45.3.5. @ApiOperation()
45.3.6. @ApiResponses
45.3.7. @ApiModel 实体类
46. Spring boot with lombok
46.1. @Builder
46.2. @Slf4j 注解
47. Spring boot with Container
47.1. Spring boot with Docker
47.1.1. 通过 Docker 命令构建镜像
47.1.2. 通过 Maven 构建 Docker 镜像
47.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]
47.1.4. curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:8888
47.2. Spring boot with Docker stack
47.2.1. 编译 Docker 镜像
47.2.2.
47.3. Spring boot with Kubernetes
47.3.1. Kubernetes 编排脚本
47.3.2. 部署镜像
48. Spring boot with command line
48.1. Maven
48.2. CommandLineRunner 例子
48.3. ApplicationRunner 例子
49. Spring Boot Actuator
49.1. Maven 依赖
49.2. 与 Spring Boot Actuator 有关的配置
49.2.1. 禁用HTTP端点
49.2.2. 安全配置
49.2.3. 修改 actuator 地址
49.2.4. 关机
49.3. actuator 接口
49.4. 健康状态
49.4.1. 健康状态
49.4.2. 自定义健康检查
49.5. info 配置信息
49.5.1. application.properties 配置静态信息
49.5.2. 动态信息
49.6. beans 信息
49.7. caches
49.8. conditions
49.9. configprops 配置文件
49.10. env 环境变量
49.11. logfile 日志
49.12. threaddump 线程信息
49.13. 计划任务
49.14. metrics
49.15. 控制器映射 URL
49.16. 自定义监控指标
50. SpringBootTest
50.1. Maven 依赖
50.2. 测试类
50.2.1. Junit基本注解介绍
50.3.
50.3.1. Assert.assertEquals 判断相等
50.3.2. Assert.assertTrue
50.4. JPA 测试
50.5. TestRestTemplate
50.6. Controller单元测试
50.7. WebTestClient
51. Spring boot with Aop
51.1. Aspect
51.1.1. Maven
51.1.2. Pojo 类
51.1.3. Service 类
51.1.4. Aspect 类
51.1.5. 控制器
51.1.6. Application
51.1.7. 测试
52. Spring boot with starter
52.1. 实现 starter
52.1.1. Maven pom.xml 依赖包
52.1.2. 配置文件处理
52.1.3. 自动配置文件
52.1.4. 启用 starter 的自定义注解
52.2. 引用 starter
52.2.1. Maven pom.xml 引入依赖
52.2.2. 通过注解配置 starter
52.2.3. 测试运行结果
53. Spring boot with Monitor
53.1. Spring boot with Grafana
53.1.1. Springboot 集成 InfluxDB
53.1.2. InfluxDB
53.2. Spring Boot with Prometheus
53.2.1. Maven 依赖
53.2.2. application.properties 配置文件
53.2.3. 启动类
53.2.4. 测试
53.2.5. 控制器监控
53.2.6. 自定义埋点监控
55. Spring boot with Git version
55.1. CommonRestController 公共控制器
55.2. VersionRestController 测试控制器
55.3. 创建 .gitattributes 文件
56. Spring boot with Session share
56.1. Redis
56.1.1. Maven
56.1.2. application.properties
56.1.3. Application
56.2. 测试 Session
56.3. JDBC
56.4. Springboot 2.1
57. Spring boot with Caching
57.1. maven
57.1.1. Redis
57.2. 启用缓存 @EnableCaching
57.3. 设置缓存 @Cacheable
57.3.1. 多参数处理
57.3.2. 对象参数
57.3.3.
57.3.4. 参数索引
57.3.5. 自动生成 key
57.3.6. SpEL表达式
57.3.7. 排除 null 结果
57.3.8. 排除 empty
57.4. 更新缓存 @CachePut
57.5. 删除缓存 @CacheEvict
57.6. 组合操作 @Caching
57.7. 序列化
57.8. 解决Expire 和 TTL 过期时间
57.9. Cannot serialize
58. Spring boot with Email
58.1. jakarta.mail
58.2. spring-boot-starter-mail
58.2.1. Maven
58.2.2. Resource
58.2.3. POJO
58.2.4. RestController
58.2.5. Test
58.3. 用法详解
58.3.1. 开启 DEBUG
58.3.2. SMTP SSL 配置
58.3.3. SMTP TLS 配置
58.3.4. 发送文本邮件
58.3.5. 发送HTML邮件
58.3.6. 发送带附件的邮件
59. Spring boot with Hessian
59.1. Maven
59.2. Application
59.3. HessianServiceExporter
59.4. Service
59.5. RestController
60. Spring boot with Async
60.1. Callable 实现异步
60.2. WebAsyncTask 实现异步
60.3. DeferredResult 实现异步返回结果
60.4. 带有返回值的异步任务
60.4.1. Future
60.4.2. CompletableFuture
60.5. 默认简单线程池 SimpleAsyncTaskExecutor
60.5.1. 配置线程池
60.5.2. @Service/@Component 中异步执行
60.5.3. applicationTaskExecutor
60.6. ThreadPoolTaskExecutor 自定义线程池
60.6.1. 最简单的配置
60.6.2. 队列
60.6.3. 定义多个线程池
60.6.4. 实现 AsyncConfigurer 接口方式创建自定义连接池
60.6.5. 继承 AsyncConfigurerSupport 创建自定义连接池
60.6.6. 生产环境完整代码 @Bean 注入方式
60.6.7. 通过 @Bean 覆盖掉 SimpleAsyncTaskExecutor
60.7. 自定义线程池 ThreadPoolExecutor
60.7.1. ThreadPoolExecutor
60.7.2. 注入自定义线程池bean
60.8. 设置线程名称
60.9. 线程池监控
60.10. 注意事项
61. Springboot with Ethereum (web3j)
61.1. Maven
61.2. application.properties
61.3. TestRestController
61.4. 测试
62. Java Record 新特性
62.1. Record 替代 POJO 类
62.2. Record 作为 Properties
62.3. Record 作为实体类
62.4. Record 作为 Service
62.5. Record 作为 Controller
63. Spring boot with Retryable
63.1. @EnableResilientMethods
63.1.1. @ConcurrencyLimit 限流
63.1.2. @Retryable 重试
63.2. spring-retry
63.2.1. spring-retry 依赖
63.2.2. @EnableRetry 启用重试
63.2.3.
63.2.4. 高级用法
V. Spring Framework
64. Spring 框架
64.1. @Bean
64.1.1. @Scope 定义类型
64.1.2. InitializingBean
64.2. URL 拼装/解析
64.3. ServletUriComponentsBuilder
64.4. URL 路径相关
64.5. 声明式 HTTP 客户端 HttpExchange
64.5.1. 支持的注解类型
64.5.2. RestClient 例子
64.5.3. HTTP 头设置
65. Spring WebMVC
65.1. @EnableWebMvc
65.1.1. @PostConstruct
65.2. @Controller
65.2.1. @RequestMapping
65.2.2. @GetMapping
65.2.3. @PostMapping
65.2.4. @RequestBody
65.2.5. RequestMapping with Request Parameters - @RequestParam
65.2.6. @RequestHeader - 获取 HTTP Header 信息
65.2.7. RequestMapping with Path Variables - @PathVariable
65.2.8. @MatrixVariable注解,RFC3986定义URI的路径(Path)中可包含name-value片段
65.2.9. @ModelAttribute
65.2.10. @ResponseBody
65.2.11. @ResponseStatus 设置 HTTP 状态
65.2.12. @CrossOrigin
65.2.13. @CookieValue - 获取 Cookie 值
65.2.14. @SessionAttributes
65.2.15. ModelAndView
65.2.16. HttpServletResponse
65.2.17. HttpServletRequest
65.3. @RestController
65.3.1. 接口设计中 URL 参数,FORM 参数,JSON 怎么选择
65.3.2. 返回迭代器
65.3.3. 上传文件
65.3.4. 返回实体
65.3.5. JSON
65.3.6. 处理原始 RAW JSON 数据
65.3.7. 返回 JSON 对象 NULL 专为 "" 字符串
65.3.8. XML
65.3.9. 兼容传统 json 接口
65.3.10. 上传文件
65.3.11. 下载文件
65.3.12. Mime/MediaType
65.3.13. Spring boot with csv
65.3.14. Json 处理
65.3.15. synchronized
65.3.16. Spring boot with Emitter
65.3.17. forward 转发
65.4. Springboot 4.0
65.4.1. Api 版本控制
65.5. View
65.5.1. 配置静态文件目录
65.5.2. 添加静态文件目录
65.5.3. Using Spring’s form tag library
65.5.4. Thymeleaf
65.5.5. FreeMarker
65.5.6. i18n 国际化
65.6. Spring boot with Webpage
65.6.1. Maven
65.6.2. application.properties
65.6.3. Application
65.6.4. IndexController
65.6.5. src/main/webapp/WEB-INF/jsp/index.jsp
65.6.6. 集成模板引擎
65.7. Spring boot with Velocity template
65.7.1. Maven
65.7.2. Resource
65.7.3. Application
65.7.4. RestController
65.7.5. Test
65.8. Spring boot with Thymeleaf
65.8.1. Maven
65.8.2. application.properties
65.8.3. Controller
65.8.4. HTML5 Template
65.9. 校验器(Validator)
65.9.1. 依赖
65.9.2. 常规用法
65.9.3. 常用注解
65.9.4. 在 Service 中使用 Validator 检查数据
65.9.5. 自定义注解
65.10. Interceptor/Filter 拦截器/过滤
65.10.1. Session 拦截
65.10.2. Token 拦截
65.10.3. Authorization Bearer
65.10.4. 过滤器
65.10.5. 拦截器获取PathVariable变量
65.10.6. WebMvcConfigurer 拦截
65.10.7. Session 登录拦截器
65.11. String boot with RestTemplate
65.11.1. RestTemplate Example
65.11.2. GET 操作
65.11.3. POST 操作
65.11.4. PUT 操作
65.11.5. Delete 操作
65.11.6. 上传文件
65.11.7. HTTP Auth
65.11.8. PKCS12
65.11.9. Timeout 超时设置
65.12. RestClient
65.12.1. 创建 RestClient
65.12.2. Get 操作
65.12.3. Post Json
65.12.4. HTTP Authorization Basic
65.12.5. onStatus
65.12.6. Timeout 超时设置
65.12.7. 下载二进制流
65.12.8. 上传文件
65.12.9. Springboot 4.0 Version 版本号
67. Service
67.1. Application
67.2. 定义接口
67.3. 实现接口
67.4. 调用 Service
67.5. context.getBean 调用 Service
67.6. AopContext
67.7. Service 单例/多例模式
67.7.1. Service 是单例模式
67.7.2. Service 多例实现
67.8. 构造方法
68. Tomcat Spring 运行环境
68.1. Maven
68.2. Spring MVC configuration
68.3. Tomcat
68.4. 集成 Mybatis
68.4.1. pom.xml
68.4.2. properties
68.4.3. dataSource
68.4.4. SqlSessionFactory
68.4.5. Mapper 扫描
68.4.6. Mapper 单一class映射
68.4.7. Service
68.4.8. 测试实例
69. WebFlux framework
69.1. Getting Started
69.1.1. Maven
69.1.2. Application
69.1.3. RestController
69.1.4. 测试
69.2. WebFlux 与 SprintMVC 有什么不同?
69.2.1. 实验程序
69.2.2. 实验结果
69.3. WebFlux Router
69.3.1. Component 原件
69.3.2. 路由配置
69.4. RestController
69.4.1. Post 数据
69.4.2. Thymeleaf
69.4.3. Mono
69.4.4. Flux 返回多条数据
69.4.5. SSE
69.4.6. 末尾连接字符串
69.4.7. Flux scan
69.4.8. ConnectableFlux
69.4.9. 上传文件并保存
69.5. Newline Delimited JSON (NDJSON)
69.6. WebClient
69.6.1. 配置 WebClient
69.6.2. @Controller/@RestController 实例
69.6.3. Get 请求实例
69.6.4. URI 参数
69.6.5. 查询参数
69.6.6. Post 操作演示
69.6.7. Post 表单数据
69.6.8. 上传文件
69.6.9. 设置 HTTP 头
69.6.10. 同步阻塞等待返回结果
69.6.11. websocket
69.6.12. 获取 HTTP 链接状态
69.6.13. Http Base Authentication - 401 Unauthorized
69.6.14. SSE(Server-Sent Events)
69.6.15. 超时时间
69.6.16. share() 共享订阅数据
69.6.17. 打印调试日志
69.6.18. 解决 WebClient 截断 URI的问题
69.6.19. 异常处理
69.7. Webflux 安全
69.7.1. Token 拦截器
69.7.2. JWT
69.7.3. spring-boot-starter-security
69.8. R2DBC
69.8.1. MySQL
69.8.2. R2dbcEntityTemplate
69.8.3. MySQL Point 数据类型
69.9. Webflux Redis
69.9.1. Maven Redis 依赖
69.9.2. Redis 配置
69.9.3. Config
69.9.4. Service
69.9.5. RestController
69.10. Webflux Mongdb
69.10.1. Maven 依赖
69.10.2. Repository
69.10.3. Service
69.10.4. 控制器
69.11. 常见问题
69.11.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.
69.11.2. @EnableWebFluxSecurity 与 @EnableReactiveMethodSecurity 不生效
69.11.3. webflux netty 不支持 Content-Type: application/x-www-form-urlencoded
VI. Spring Data
70. EntityManager
71. Spring Data with JdbcTemplate
71.1. execute
71.2. queryForInt
71.3. queryForLong
71.4. queryForObject
71.4.1. 返回整形与字符型
71.4.2. 查询 Double 类型数据库
71.4.3. 返回日期
71.4.4. 返回结果集
71.4.5. 通过 "?" 向SQL传递参数
71.4.6. RowMapper 记录映射
71.5. queryForList
71.5.1. Iterator 用法
71.5.2. for 循环
71.5.3. forEach 用法
71.6. queryForMap
71.7. query
71.7.1. ResultSet
71.7.2. ResultSetExtractor
71.7.3. RowMapper
71.8. queryForRowSet
71.9. update
71.10. MapSqlParameterSource
71.11. 实例参考
71.11.1. 参数传递技巧
72. Spring Data with MySQL
72.1. 选择数据库表引擎
72.2. 声明实体
72.2.1. @Entity 声明实体
72.2.2. @Table 定义表名
72.2.3. @Id 定义主键
72.2.4. @Column 定义字段:
72.2.5. 非数据库字段
72.2.6. @Lob 注解属性将被持久化为 Blog 或 Clob 类型
72.2.7. @NotNull 不能为空声明
72.2.8. @Temporal 日期定义
72.2.9. 创建日期
72.2.10. @DateTimeFormat 处理日期时间格式
72.2.11. Enum 枚举数据类型
72.2.12. SET 数据结构
72.2.13. JSON 数据类型
72.2.14. 嵌入
72.2.15. @JsonIgnore
72.2.16. @EnableJpaAuditing 开启 JPA 审计功能
72.2.17. 注释 @Comment
72.2.18. @Pattern 数据匹配
72.2.19. 实体继承
72.2.20. 虚拟列
72.2.21. 语言区域
72.3. 映射集合属性
72.3.1. List 集合
72.3.2. 数组集合
72.3.3. Map 集合
72.3.4. Set 集合
72.3.5. 外键名称
72.3.6. 集合表子查询
72.4. 外键
72.4.1. @JoinColumn
72.4.2. @OneToOne
72.4.3. OneToMany 一对多
72.4.4. ManyToMany 多对多
72.4.5. 外键级联删除
72.4.6. 外键级联操作
72.4.7. @JoinTable
72.4.8. @OrderBy
72.4.9. @JsonIgnoreProperties
72.4.10. 允许外键为 NULL
72.4.11. 只要外键,不要数据结构
72.5. 索引
72.5.1. 普通索引
72.5.2. 组合索引
72.5.3. 唯一索引
72.6. Repository/CrudRepository/PagingAndSortingRepository/JpaRepository
72.6.1. JpaRepository
72.6.2. CrudRepository
72.6.3. PagingAndSortingRepository
72.6.4. findByXXX
72.6.5. count 操作
72.6.6. delete 删除操作
72.6.7. IsNull
72.6.8. In/NotIn
72.6.9. TRUE / FALSE
72.6.10. 比较数值大小
72.6.11. 判断日期和时间 Before / After
72.6.12. Between
72.6.13. Exists
72.6.14. OrderBy
72.6.15. GreaterThan
72.6.16. Sort 排序操作操作
72.6.17. Pageable 翻页操作
72.6.18. @DynamicInsert 与 @DynamicUpdate
72.6.19. 继承已存在的 Repository
72.6.20. Optional
72.6.21. stream 用法
72.7. TransactionTemplate
72.8. JPQL @Query
72.8.1. @Modifying 更新/删除
72.8.2. 参数传递
72.8.3. 原生 SQL 操作
72.8.4. @Query 与 Pageagble
72.8.5. 自定义返回字段
72.8.6. 返回指定字段
72.8.7. 返回指定的模型
72.8.8. 通过定义接口,返回指定字段
72.8.9. 修改返回数据
72.8.10. 事务 @Transactional
72.8.11. IN / NOT 子查询
72.9. FAQ 常见问题
72.9.1. Could not write JSON: failed to lazily initialize a collection of role
72.9.2. Query did not return a unique result: 2 results were returned
72.9.3. Executing an update/delete query
72.9.4. could not initialize proxy [cn.netkiller.domain.Device#16] - no Session
72.9.5. this is incompatible with sql_mode=only_full_group_by
72.9.6. A TupleBackedMap cannot be modified
73. Spring Data with Redis
73.1. 集成 Redis XML 方式
73.1.1. pom.xml
73.1.2. springframework-servlet.xml
73.1.3. Controller
73.1.4. index.jsp
73.1.5. 测试
73.2. 通过构造方法实例化 Redis
73.3. StringRedisTemplate 基本用法
73.3.1. 存储数据
73.3.2. 获取值并删除
73.3.3. 取出数据
73.4. RedisTemplate
73.4.1. 设置缓存时间
73.4.2. increment
73.4.3. 删除 key
73.4.4. 对象存储
73.4.5. 获取过期时间
73.4.6. 过期时间未执行
73.4.7. 判断 key 是否存在
73.5. ValueOperations
73.5.1. 字符串截取
73.5.2. 追加字符串
73.5.3. 设置键的字符串值并返回其旧值
73.5.4. 返回字符串长度
73.5.5. 如果key不存便缓存。
73.5.6. 缓存多个值 /获取多个值 multiSet / multiGet
73.5.7. setBit / getBit 二进制位操作
73.6. 列表操作
73.6.1. rightPush
73.6.2. rightPushAll
73.6.3. rightPushIfPresent
73.6.4. leftPush
73.6.5. leftPushAll
73.6.6. range
73.7. SetOperations 数据类型
73.7.1. 返回集合中的所有成员
73.7.2. 取出一个成员
73.7.3. 随机获取无序集合中的一个元素
73.7.4. 随机获取 n 个成员(存在重复数据)
73.7.5. 随机获取 n 个不重复成员
73.7.6. 在两个 SET 间移动数据
73.7.7. 成员删除
73.7.8. 返回集合数量
73.7.9. 判断元素是否在集合成员中
73.7.10. 对比两个集合求交集
73.7.11. 对比两个集合求交集,然后存储到新的 key 中
73.7.12. 合并两个集合,并去处重复数据
73.7.13. 合并两个集合去重复后保存到新的 key 中
73.7.14. 计算两个合集的差集
73.7.15. 计算两个合集的差集,然后保存到新的 key 中
73.7.16. 遍历 SET 集合
73.8. ZSetOperations 有序的 set 集合
73.9. HashOperations
73.9.1. put
73.9.2. putAll
73.9.3. 从键中的哈希获取给定hashKey的值
73.9.4. delete
73.9.5. 确定哈希hashKey是否存在
73.9.6. 从哈希中获取指定的多个 hashKey 的值
73.9.7. 只有hashKey不存在时才能添加值
73.9.8. 获取整个Hash
73.9.9. 获取所有key
73.9.10. 通过 hashKey 获取所有值
73.9.11. 值加法操作
73.9.12. 遍历 Hash 表
73.10. 存储 Json 对象
73.10.1. 集成 RedisTemplate 定义新类 JsonRedisTemplate
73.10.2. 配置 Redis
73.10.3. 测试
73.11. Spring Data Redis - Repository Examples
73.11.1. @EnableRedisRepositories 启动 Redis 仓库
73.11.2. 定义 Domain 类
73.11.3. Repository 接口
73.11.4. 测试代码
73.12. Redis Pub/Sub
73.12.1. MessageListener 方案
73.12.2. @RedisListener 注解方案
73.12.3. 线程池
73.13. CacheService
73.14. FAQ
73.14.1. Spring Data Redis
74. Spring Data with MongoDB
74.1. Example Spring Data MongoDB
74.1.1. pom.xml
74.1.2. springframework-servlet.xml
74.1.3. POJO
74.1.4. Controller
74.1.5. 查看测试结果
74.1.6. 条件查询
74.2. MongoDB 多数据源
74.2.1. Maven
74.2.2. Application 禁止自动配置 MongoDB
74.2.3. application.properties 新增配置项
74.2.4. MongoDB 配置类
74.2.5. 创建 Document 关系映射类
74.2.6. 测试控制器
74.2.7. 测试
74.3. @Document
74.3.1. 指定表名
74.3.2. @Id
74.3.3. @Version
74.3.4. @Field 定义字段名
74.3.5. @Indexed
74.3.6. @CompoundIndex 复合索引
74.3.7. @TextIndexed
74.3.8. @GeoSpatialIndex 地理位置索引
74.3.9. @Transient 丢弃数据,不存到 mongodb
74.3.10. @DBRef 做外外键引用
74.3.11. @DateTimeFormat
74.3.12. @NumberFormat
74.3.13. 在 @Document 中使用 Enum 类型
74.3.14. 在 @Document 中定义数据结构 List/Map
74.3.15. GeoJson 数据类型
74.4. MongoRepository
74.4.1. 扫描仓库接口
74.4.2. findAll()
74.4.3. deleteAll()
74.4.4. save()
74.4.5. count()
74.4.6. exists() 判断是否存在
74.4.7. existsById()
74.4.8. findByXXXX
74.4.9. findAll with OrderBy
74.4.10. findAll with Sort
74.4.11. FindAll with Pageable
74.4.12. StartingWith 和 EndingWith
74.4.13. Between
74.4.14. Before / After
74.4.15. @Query
74.5. mongoTemplate
74.5.1. Save 保存
74.5.2. Insert
74.5.3. updateFirst 修改符合条件第一条记录
74.5.4. updateMulti 修改符合条件的所有
74.5.5. 查找并保存
74.5.6. upsert - 修改符合条件时如果不存在则添加
74.5.7. 删除
74.5.8. 查找一条数据
74.5.9. 查找所有数据
74.5.10. Query
74.5.11. Criteria
74.5.12. Update
74.5.13. BasicUpdate
74.5.14. Sort
74.5.15. Query + PageRequest
74.5.16. newAggregation
74.5.17. 创建索引
74.5.18. 子对象操作
74.6. GeoJson 反序列化
74.7. FAQ
74.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
75. Spring Data with Elasticsearch
75.1. 内嵌 Elasticsearch
75.1.1. Maven
75.1.2. src/main/resources/application.properties
75.1.3. Domain Class
75.1.4. ElasticsearchRepository
75.1.5. SearchRestController
75.1.6. 测试
75.2. 集群模式
75.3. Document
75.4. Elasticsearch 删除操作
75.5. FAQ
75.5.1. java.lang.IllegalStateException: Received message from unsupported version: [2.0.0] minimal compatible version is: [5.0.0]
76. Spring boot with Data restful
76.1. Maven
77. Apache ShardingSphere
77.1. 微服务集群环境,雪花算法出现重复ID
77.1.1. 方案一、配置实现
77.1.2. 方案二、代码实现
VII. Spring Security
78. Springboot 3 + Security 6
78.1. Spring Security with HTTP Auth
78.1.1. 默认配置
78.1.2. 设置用户名和密码
78.1.3. 禁用 Security
78.1.4. 设置角色
78.2. Springboot 3 Security + OncePerRequestFilter
78.2.1. OncePerRequestFilter
78.2.2. SecurityConfiguration
78.3. SecurityFilterChain
78.4. @PreAuthorize
78.4.1. hasRole
78.4.2. hasAnyRole
78.4.3. 从 HttpServletRequest 返回的 request 变量中判断角色
78.4.4. getAuthentication() 获得角色
78.4.5. UserDetailsService
78.5. httpBasic 配置
78.5.1. 禁止 HTTP Auth
78.6. 指定 URL 限制 IP 访问
78.7. Authorization Bearer
78.8. InvalidClaimException: The Token can't be used before
79. Spring Authorization Server
79.1. Oauth2 协议
79.1.1. token
79.1.2. grant_type
79.1.3. 授权码授权模式(Authorization Code Grant)
79.1.4. 密码模式(Resource Owner Password Credentials Grant)
79.1.5. 客户端凭证模式(Client Credentials Grant)
79.1.6. 刷新 TOKEN 方式
79.2. Maven 依赖
79.3. Spring cloud with Oauth2
79.3.1. authorization_code
79.3.2. Spring boot with Oauth2 - Password
79.3.3. Spring boot with Oauth2 jwt
79.3.4. Spring boot with Oauth2 jwt 非对称证书
79.3.5. Apple iOS 访问 Oauth2
79.3.6. Oauth2 客户端
79.3.7. Android Oauth2 + Jwt example
79.3.8. RestTemplate 使用 HttpClient
79.3.9. 自签名证书信任问题
79.3.10. Principal
79.3.11. SecurityContextHolder 对象
79.3.12. 资源服务器配置
79.3.13. Client
79.3.14. Oauth2 常见问题
80. Spring boot with Spring security(2.x)
80.1. Spring security 静态配置例子
80.1.1. Maven
80.1.2. Reource
80.1.3. Application
80.1.4. WebSecurityConfigurer
80.1.5. RestController
80.1.6. 测试
80.2. Spring + Security + MongoDB
80.2.1. Account
80.2.2. AccountRepository
80.2.3. WebSecurityConfiguration
80.3. Spring Boot with Web Security(2.x)
80.3.1. EnableWebSecurity
80.3.2. Web静态资源
80.3.3. 正则匹配
80.3.4. 登陆页面,失败页面,登陆中页面
80.3.5. CORS
80.3.6. X-Frame-Options 安全
80.4. 访问控制列表(Access Control List,ACL)
80.4.1. antMatchers
80.4.2. HTTP Auth
80.4.3. Rest
80.4.4. hasRole
80.4.5. hasAnyRole()
80.4.6. withUser
VIII. Spring Cloud
81. 云服务
81.1. 讯飞云
81.1.1. AIUI
81.1.2. 讯飞 TTS
81.1.3. 语音唤醒
81.2. 阿里云
81.2.1. nuisdk-release.aar 版本问题
81.2.2. 获取 Token
81.2.3. 语音唤醒
81.2.4. CosyVoice 语音合成
82. Spring Integration
82.1. Spring Redis Lock
82.1.1. Maven 依赖
82.1.2. 配置锁
82.1.3. 使用方法
82.1.4. Service 中使用方法
82.1.5. 在定时任务中使用
82.1.6. 在Controller中使用
82.1.7. 使用模板方法模式封装
82.1.8. 读取锁过期时间
82.2. MQTT Support
82.2.1. 入站消息通道适配器
82.2.2. 出站通道适配器
82.2.3. @MessagingGateway 定义消息网管接口
82.2.4. 手动 ACK 应答
82.2.5. Spring boot with Mqtt v5
83. MyBatis
83.1. Mybatis 入门
83.2. 接口注解
84. Apache Struts
84.1. struts.xml
84.1.1. include
84.2. Struts Tags
84.2.1. property
84.2.2. set
84.2.3. url
84.2.4. s:include
84.2.5. s:action
84.2.6. HTML Form
84.2.7. iterator
84.2.8. if elseif else
84.3. Action
84.3.1. redirect
84.3.2. redirectAction
84.3.3. JSON
84.3.4. 传递 Timestamp 变量
84.4. Ajax + JSON
84.4.1. GET/POST JSON
84.5. Json 内容展示
84.5.1. 禁止方法
84.5.2. 格式化日期
84.5.3. 重命名变量名
84.5.4. org.apache.struts2.json
84.6. Interceptor
84.6.1. Session
84.7. Action 中使用线程
84.8. 日志
84.9. FAQ
84.9.1. Struts 怎样判断用户来自电脑还是移动设备
85. Apache Tiles
85.1. 配置 Tiles
85.1.1. Maven
85.1.2. web.xml
85.2. Template 配置模板
85.3. Struts tiles
86. Play
87. Servlet
87.1. Example
87.2. Session
87.3. HttpServletRequest
87.4. Filter
87.4.1. web.xml
87.4.2. Filter 类
87.5. Listener
87.5.1. web.xml
87.5.2. NewsListener 类
87.5.3. NewsTask 类
87.5.4. JSP 中心显示
87.6. JSP
87.6.1. 注释
87.6.2. pageContext
87.6.3. request
87.6.4.
87.6.5. cookie
87.6.6. session
87.6.7. page
87.6.8. trimDirectiveWhitespaces
87.6.9. include
87.6.10. jsp
87.6.11. error-page
87.6.12. JSP 编程
87.6.13. FAQ
87.7. JSTL(JavaServer Pages Standard Tag Library)
87.7.1. c:set
87.7.2. c:out
87.7.3. c:url
87.7.4. c:redirect
87.7.5. c:import
87.7.6. c:if
87.7.7. c:choose
87.7.8. c:forEach
87.7.9. empty 判断是否为空
87.7.10. JSTL fmt Tag setBundle Example
87.8. WebSocket
87.8.1. Server
87.8.2. Client
88. Log
88.1. Logback
88.1.1. Maven 包
88.1.2. Example
88.2. slf4j
88.3. log4j
88.3.1. 安装 Log4j
88.3.2. log4j 环境变量
88.3.3. Log4j Example
88.3.4. log4j.properties
89. AMQP(Advanced Message Queuing Protocol)
89.1. Send and Recv
89.2. direct
90. NoSQL
90.1. MongoDB
90.1.1. pom.xml
90.1.2. 插入操作
90.1.3. 读取操作
91. Elasticsearch API
91.1. Client
91.2. insert
91.3. Get
91.4. delete
91.5. Search
91.6. Query 查询
91.6.1. match all 匹配所有数据
91.6.2. match 匹配查询
91.6.3. match phrase 短语精准匹配
91.7. Filter 过滤
91.7.1. term
91.7.2. range
91.8. Sorting
91.9. 返回 Source 字段
91.10. Count
91.11. Example 范例
91.11.1. Spring boot 案例
91.12. FAQ
91.12.1. 显示查询 JSON 字符串
92. Jersey - RESTful Web Services in Java.
92.1. Client 2.x
92.1.1. Maven 版本
92.1.2. GET 操作
92.1.3. GET + Auth 用户认证
92.2. Client 1.x
92.2.1. Jersey + Auth + HTTP2 + SSL
93. Apache HttpComponents
93.1. org.apache.commons.lang3
93.1.1. HTML 标签处理
93.1.2. StringUtils.join 使用特定字符链接字符串
93.1.3. RandomStringUtils
93.2. commons-text
93.2.1. 禁止转译 json
93.3. Apache HttpClient
93.3.1. Maven
93.3.2. HTTP POST 操作
93.3.3. HTTPS
93.3.4. HTTP/2
93.3.5. Java11
93.3.6. Host name 'api.netkiller.cn' does not match the certificate subject provided
93.3.7. HttpStatus
93.3.8.
94. Cache
94.1. java memcached client
94.2. Jedis
94.2.1. 认证
94.2.2. jedis.keys
94.3. Ehcache
95. Kafka
95.1. 安装 Kafka 环境
95.2. Maven
95.3. 启动 kafka
95.4. 入门例子
95.4.1. 订阅例子
95.4.2. 发布例子
95.5. 线程例子
96. Software Development Kit
96.1. JAVE(Java Audio Video Encoder)
96.2. Google
96.2.1. com.google.gson
96.2.2. Guava
96.3. Mahout
96.3.1. 推荐系统
96.4. Hessian
96.5. quartz-scheduler
96.6. Redisson
IX. Android
97. Android Studio
97.1. 卸载 Android Studio
97.2. 代码格式化
97.3. 设置兼容最低SDK版本
97.4. SDK Tools
97.4.1. 接受 License
97.4.2. 查看 SDK 列表
97.4.3. 按照 Android SDK
97.5. 命令行操作
97.6. adb 命令
97.6.1. 获得 root 权限
97.6.2. 设备管理
97.6.3. Shell
97.6.4. 设备 ID
97.6.5. 查看安卓版本
97.6.6. Logcat
97.6.7. 上传文件
97.6.8. 下载文件
97.6.9. 安卓 .apk bk
97.6.10. 屏幕尺寸
97.6.11. dump 系统信息
97.6.12. 解锁
97.6.13. 蓝牙管理
97.6.14. 声卡
97.6.15. 摄像头
98. AndroidManifest.xml
98.1. SDK 版本配置
98.2. 开启网络
98.3. 文件存储权限
98.4. 相机权限
98.5. GPS 定位权限
98.6. 全屏-无标题
98.7. 设置为默认开机启动
98.8. 开机启动
98.9. 默认横屏
98.10. 禁止屏幕旋转变化
99. 设备
99.1. 环境变量
99.1.1. 扩展存储
99.1.2. 下载缓存目录
99.1.3. 数据目录
99.2. 配置文件
99.2.1. *.properties 文件
99.2.2. 再 AndroidManifest.xml 使用 meta-data element 定义
99.2.3. 再 build.gradle 文件中配置 productFlavors
99.2.4. 从 assets 目录读取配置文件
99.3. 设备信息
99.4. Physical density
99.5. 声卡
99.5.1. 播放
99.5.2. 录音
99.5.3. 查看声卡信息
99.5.4. /proc/asound 设备信息
99.5.5. 查看声卡当前占用设备
99.5.6. tinymix 设置声卡参数
99.5.7. 麦克风阵列调试
99.6. 判断是平板,还是手机
99.7. 蓝牙设备管理
99.7.1. 进入蓝牙设置界面
99.7.2. 通过发送广播处理蓝牙
99.7.3. 蓝牙禁用/启用
99.7.4. 获取蓝牙设备
99.7.5. 查询已绑定设备
99.8. USB 设备
99.8.1. USB 音频设备
100. Activity
100.1. 界面佈局
100.1.1. setContentView
100.1.2. 隐藏虚拟键
100.1.3. 保持屏幕常开
100.1.4. 标题栏添加返回按钮
100.2. 切换 Activity
100.2.1. startActivity()
100.2.2. App 间跳转
100.2.3. intentActivityResultLauncher 跳转
100.2.4. startActivityForResult 替代方案
100.3. 生命周期
100.3.1. 定时关闭
100.3.2. 恢复触发
100.3.3. 返回触发
100.3.4. Activity 关闭
100.3.5. 重启自己
100.4. Activity 间数据传递
100.4.1. Intent 方式
100.4.2. Bundle 方式
100.4.3. Flag 属性
100.4.4. 返回值
100.5. DataBinding
100.5.1. 启用 DataBinding
100.5.2. MainActivity 中使用 ActivityMainBinding
100.5.3. ViewDataBinding 例子
100.6. 键盘事件
100.6.1. onKeyDown 键盘按下事件
100.6.2. dispatchKeyEvent
100.6.3. 屏蔽 KeyEvent.KEYCODE_BACK
100.6.4. 判断按下次数
100.7. 鼠标事件
100.8. 分享
100.8.1. 分享文本内容
100.8.2. 分享图片
100.8.3.
100.9. 剪切板
100.10. 软键盘控制
100.11. 自定义事件
100.11.1. 按钮点击事件
100.11.2. OnCheckedChangeListener
100.11.3. CustomOnItemSelectedListener
100.11.4. CustomOnScrollListener
100.11.5. CustomOnTabSelectedListener
100.12. Res 资源
100.12.1. 通过名称查找 layout ID
100.12.2. 查找 drawable 资源 ID
100.12.3. 获取 color 颜色 ID
100.12.4. 获取 array.xml 文件下某个字段的 ID
100.12.5. 获取 style.xml 文件下的某个样式的 id
100.12.6. 主题 themes.xml
101. Fragment
101.1. 启动 Fragment
101.2. 关闭 Fragment
101.3. 在 Fragment 中使用 findViewById
101.4. 在 Fragment 跳转 Activity
101.5. 在 Fragment 跳转 Activity 同时携带 Intent 参数
101.6. Fragment 中调用 getPackageManager()
101.7. 在 Fragment 中使用 runOnUiThread
101.8. Fragment 中调用 findViewById
101.9. 替换 FrameLayout
101.10. Fragment 接收 BroadcastReceiver 广播
101.11. Fragment 加载报错 java.lang.IllegalArgumentException: No view found for id ...
101.12. 使用 TabLayout 切换 Fragment
102. Resources
102.1. strings.xml
102.1.1. 字符串
102.1.2. 定义数组
102.1.3. 获取 Resource
102.1.4. Fragment 获取 Resource
102.2. dimens.xml
103. Palette 视觉设计
103.1. 禁止屏幕休眠
103.2. 颜色设置
103.2.1. 颜色设置
103.3. 样式布局
103.3.1. ConstraintLayout
103.3.2. LinearLayout
103.3.3. FrameLayout
103.3.4. 声音波形图
103.4. UI 界面
103.4.1. Toast
103.4.2. Dialog
103.4.3. DatePicker
103.4.4. Snackbar - Toast 的替代者
103.5. Text
103.5.1. Text 相关属性
103.5.2. TextView
103.5.3. EditText
103.5.4. 光标移动到行尾
103.5.5. 禁止选择文本
103.5.6. 设置 app:backgroundTint
103.5.7. 禁止滚动条
103.6. Button
103.6.1. 启用禁用
103.6.2. 实现 OnClickListener 接口
103.6.3. Fragment 中使用 Button
103.6.4. 圆形按钮
103.6.5. ImageButton
103.6.6. 添加悬浮操作按钮
103.7. Switch
103.8. Widgets
103.8.1. ImageView
103.8.2. TextClock
103.8.3. 进度条
103.8.4. NestedScrollView +
103.9. Containers
103.9.1. CardView
103.9.2. RecyclerView
103.9.3. NavigationView
103.9.4. 底部导航
103.9.5. TabLayout
103.9.6. ViewPager2
103.9.7. Navigation
103.10. 屏幕
103.10.1.
103.10.2. 媒体路由
103.10.3. 分辨率
103.10.4. 尺寸
103.10.5. 全屏显示
103.10.6. 音频处理
103.10.7. 屏幕触摸事件 onTouch(View view, MotionEvent motionEvent)
103.10.8. 手势事件
103.10.9. SimpleOnGestureListener
103.10.10. SimpleOnScaleGestureListener
103.11. 带有小三角指示的消息框
103.11.1. 左侧三角
103.11.2. 右侧三角
103.11.3. 正三角
103.11.4. 倒三角
103.11.5. 文本边框
103.11.6. 布局
104. Schedule 计划任务
104.1. 使用 Runnable 和 Handler 实现定时执行
104.1.1. 循环执行
104.1.2. 延迟执行
104.2. TimerTask 实现循环播放
104.2.1. Time 和 TimerTask 定时刷新
104.2.2. TimerTask 更新 UI
104.3. ScheduledExecutorService
105. Internationalization i18n with Android (国际化)
105.1. 创建国际化文件
105.2. strings.xml 文件
105.3. 翻译语言
105.4. 引用国际化文件
105.5. 切换语言
106. 存储
106.1. 获得存储目录
106.1.1. 用户存储目录
106.1.2. Assets 目录
106.1.3. 公共存储目录
106.1.4. 内部存储
106.1.5. 扩展存储
106.1.6. 文件夹类型
106.2. FileProvider 配置
106.3. SD Card
106.3.1. SD Card 状态
106.3.2. Android 11 申请 sdcard 权限
106.4. 下载管理
106.4.1. 从 URL 下来文件
106.4.2. 安装 APK
106.4.3. 下载后接收广播通知
106.5. android.os.FileUriExposedException
106.6. 下载工具类
107. 网络
107.1. Wifi 配置
107.2. WI-FI 与 蜂窝网络 信号强度检测
107.3. OkHttp - An HTTP & HTTP/2 client for Android and Java applications
107.3.1. Gradle
107.3.2. AndroidManifest.xml 开启网络访问权限
107.3.3. okhttp 默认是 HTTPS 开启 HTTP
107.3.4. 连接池
107.3.5. HttpUrl
107.3.6. GET
107.3.7. POST
107.3.8. HTTP PUT 请求
107.3.9. http header 相关设置
107.3.10. HTTP Base Auth
107.3.11. HttpUrl.Builder 组装 URL 地址参数
107.3.12. Android Activity Example
107.3.13. Android Oauth2 + Jwt example
107.3.14. HTTP/2
107.3.15. 异步更新 UI
107.3.16. SSE 客户端
107.3.17. WebSocket Client
107.3.18. EventListener
107.3.19. 文件下来
107.4. Retrofit - https://github.com/square/retrofit
107.4.1. Gradle 依赖
107.4.2. Authorization 头
108. 相机与相册
108.1. 调用相机
108.1.1. manifest 文件
108.1.2. layout
108.1.3. Activity
108.2. 相机开发
108.2.1. 页面布局
108.2.2. 相机逻辑功能
108.3. LED flash 做手电筒
109. 多媒体开发
109.1. AudioDeviceInfo
109.2. MediaPlayer
109.2.1. 播放Raw下的元数据
109.2.2. 播放assets文件夹中的音乐
109.2.3. 播放互联网音乐
109.2.4. 使用单例模式
109.2.5. 设置速度,快进播放
109.2.6. OPUS
109.3. AudioPlayer
109.4. AudioTrack
109.5. VideoView 开发
109.5.1. 播放网络视频
109.5.2. MediaController 添加翻页事件
109.5.3. 静音播放视频
109.5.4. 更新进度条
109.5.5. 完整的例子
109.5.6. 循环播放
109.5.7. 静音播放
109.6. SoundPool
109.7. 音量控制
109.8. 麦克风
109.8.1. AudioRecord
109.8.2. 远端录音
109.8.3. 选择麦克风
109.8.4. 设置蓝牙麦克风为默认麦克风
109.8.5. 录音例子
109.8.6. Microphone 录音,蓝牙,增益
109.9. 麦克风与录音例子
109.9.1. 开启麦克风和SD卡权限
109.9.2. layout
109.9.3. Activity
109.10. MediaRecorder 录音例子
109.11. MediaCodec
109.12. ExoPlayer
109.12.1. Opus
109.13. Opus
109.13.1. Kopus - A Kotlin Multiplatform library providing OPUS audio codec functionality for Android and iOS platforms.
110. 定位
110.1. GPS + 网络 定位
110.1.1. manifest 权限配置
110.1.2. layout
110.1.3. Activity
110.2. 只从 GPS 获取定位
111. 电话
111.1. SIM 卡状态
111.2. 通信录与拨打电话
111.3. 发送短信
112. 消息广播
112.1. 动态注册
112.2. 静态注册
112.2.1. 电源管理
112.2.2. 接收不到消息
112.2.3. StaticBroadcastReceiver 完整的例子
112.3. 自定义用户消息广播
112.4. 本地广播
112.5. 动态监听广播
112.6. 广播重复接收
112.7. 指定静态广播接收者
112.8. 异步执行广播
112.9. 静态广播接收不到信息
112.10. 接受蓝牙广播
112.11. 接收 USB 设备广播
112.11.1.
112.12. Wifi 广播
112.13. LiveDataBus - 官方 AndroidX jetpack
113. Service 服务
113.1. Service的基本用法
113.1.1. manifest 文件
113.1.2. 创建 Service
113.1.3. Layout 代码
113.1.4. Activity 代码
113.2. bindService
113.3. Service 中启动线程
113.4. Service 和 Activity 通信
113.4.1. Layout
113.4.2. Service
113.4.3. Activity
113.5. Service 和 Toast
113.6. Service 中启动 Activity
113.7. Service 中更新 UI
113.8. 前台启动 Service
113.9. 在 Fragment 中启动 Service
114. Android 多线程
114.1. Thread
114.1.1. 线程名称
114.1.2. 线程名称
114.1.3. Sleep
114.2. Handler
114.3. HandlerThread
114.3.1. Handler post
114.3.2. 发送消息
114.3.3. 完整例子
114.3.4. 获取线程名称
114.3.5. HandlerThread 队列
114.3.6. Token 应用
114.4. 消息队列
114.4.1. 非阻塞队列 ConcurrentLinkedQueue
115. Notification 通知中心
115.1. 文本通知
115.2. 添加点击操作
115.3. Notification 给 Activity 传值
115.4. 通过 isNotification 判断是否需要执行 onStop() 和 onDestroy()
116. NFC (Near field communication)
116.1. AndroidManifest.xml 文件配置
116.2. Loyout 文件
116.3. Activity 文件
117. 图形开发
117.1. Paint
117.1.1. Paint.setTextSize() SP to PX
117.2. AnimationDrawable
117.3. 矩形
117.4. 路径
118. EventBus
118.1. 添加 EventBus 依赖到项目Gradle文件
118.2. 快速开始一个演示例子
118.2.1. 创建 MessageEvent 类
118.2.2. Layout
118.2.3. Activity
118.3. Sticky Events
118.3.1. MainActivity
118.3.2. StickyActivity
118.3.3. MessageEvent
118.3.4. 删除粘性事件
118.4. 线程模型
118.5. 配置 EventBus
118.6. 事件优先级
118.7. 捕获异常事件
119. Android MQTT
119.1. build.gradle 添加依赖包
119.2. AndroidManifest.xml
119.3. Android Mqtt v5 例子
120. 数据库
120.1. SharedPreferences
120.1.1. 操作模式
120.1.2. 保存数据
120.1.3. 读取数据
120.1.4. 通过 key 查询数据是否存在
120.1.5. 删除数据
120.1.6. 清空数据
120.1.7. 对象存储
120.1.8. SharedPreferences 读取物理存储文件
120.2. Room
120.2.1. 快速开始并掌握 Room 数据库
120.2.2. 组合唯一索引
120.3. Preferences DataStore
120.4. Proto DataStore
121. 杂项
121.1. Caused by: java.net.UnknownServiceException: CLEARTEXT communication to 47.100.253.187 not permitted by network security policy
121.2. 设计模式
121.2.1. 单例模式
121.3. Android OS 包
121.3.1. 进程ID
121.3.2. handler
121.4. fastjson android
121.4.1. 对象转字符串
121.4.2. JsonObject 转对象
121.4.3. 字符串 与 json 互转
121.4.4. json 转 数组
121.4.5. JSON数组转List
121.4.6. Map 与 Json 互转
121.5. Butter Knife
121.6. Android Things
121.6.1. GPIO
122. FAQ
122.1. java.net.UnknownServiceException: CLEARTEXT communication to 192.168.0.185 not permitted by network security policy
122.2. Caused by: android.os.NetworkOnMainThreadException
122.3. java.lang.IllegalStateException: Player is accessed on the wrong thread.
122.4. Manifest merger failed with multiple errors, see logs
122.5. android.os.NetworkOnMainThreadException
122.6. package does not have vibrate permission
122.7. Can't create handler inside thread Thread[...,5,main] that has not called Looper.prepare()
122.8. java.lang.SecurityException: Permission denied (missing INTERNET permission?)
122.9. java.io.IOException: Cleartext HTTP traffic to **** not permitted
122.10. 调试技巧,找不到哪里调用
123. 从 Java 到 Kotlin
123.1. 数据类型与数据结构
123.1.1. 字符串
123.1.2. 日期时间
123.1.3. 数组
123.1.4. List 列表
123.1.5. Map 图
123.1.6. let
123.2. Class
123.2.1. 枚举
123.3. 流程控制
123.3.1.
123.3.2. 循环
123.4. Callback 回调
123.4.1. Consumer
123.4.2. callback
123.4.3. 定义接口方式
123.5. 界面操作
123.5.1. findViewById
123.5.2. runOnUiThread
123.5.3. Fragment
123.5.4. ImageView
123.6. Thread
123.6.1. Handler
123.6.2.
123.7. 定时与延迟执行
123.7.1. Timer
123.7.2.
123.8. MutableLiveData
123.8.1. MutableLiveData 使用 Pair 传 key, value 两个值
123.8.2. MutableLiveData 传自定义对象
123.9. Flow
123.9.1. MutableSharedFlow
123.10. 协程
123.10.1. GlobalScope
123.10.2. MainScope
123.10.3. lifecycleScope
123.10.4.
123.10.5. viewModelScope
123.10.6. 协程上下文与继承关系
124. 云服务
124.1. 讯飞云
124.1.1. AIUI
124.1.2. 讯飞 TTS
124.1.3. 语音唤醒
124.2. 阿里云
124.2.1. nuisdk-release.aar 版本问题
124.2.2. 获取 Token
124.2.3. 语音唤醒
124.2.4. CosyVoice 语音合成
1. 附录
1.1. 一致性算法

表格清单

1. Netkiller 系列免费电子书

范例清单

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
35.1. Example Spring boot with Oracle
8. RedisTemplate
43.1. Spring boot with Apache kafka.
43.2. Spring boot with Apache kafka.
43.3. Test Spring Kafka
58.1. Spring boot with Email (pom.xml)
65.1. Spring boot with Velocity template (pom.xml)
68.1. MyBatis
73.1. Spring Data Redis Example
74.1. Spring Data MongoDB - springframework-servlet.xml
94.1. memcached.java
104.1.