Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

Netkiller Java 手札(2023版)

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

Mr. Neo Chan, 陈景峯(BG7NYT)



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


文档始创于 2015-11-10

电子书最近一次更新于 2023-05-09 21:11:02

版权声明

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

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. 联系方式
1. Java
1.1. JVM
1.1.1. Almalinux / RockyLinux
1.1.2. CentOS 8 Java 14
1.1.3. Java 版本切换
1.1.4. 安装 Java 6
1.1.5. java-1.8.0-openjdk
1.1.6. docker 环境
1.1.7. java - Launches a Java application.
1.1.8. jar
1.1.9. jdeps - Java class dependency analyzer.
1.1.10. JShell
1.1.11. jlink
1.2. Java 相关命令
1.2.1. jps
1.3. System
1.3.1. user.dir
1.3.2. java.io.tmpdir
1.3.3. 打印当前 Java 文件的默认编码
1.3.4. 自定义
1.3.5. System.in 标准输入(Stdin)
1.4. exec 运行shell
1.5. 数据类型
1.5.1. var 本地变量类型推断
1.5.2. Integer
1.5.3. String
1.5.4. 类型转换
1.5.5. Date
1.5.6. Array
1.5.7. float
1.5.8. double
1.5.9. BigDecimal
1.5.10. StringBuffer
1.5.11. enum
1.5.12. byte 类型
1.6. 流程控制
1.6.1. Switch
1.7. 数据结构
1.7.1. List
1.7.2. ArrayList
1.7.3. Set 转为 List
1.7.4. Map
1.7.5. Queue
1.7.6. Stream
1.7.7. Optional
1.8. Network
1.8.1. URL
1.8.2. 获取IP地址何机器名
1.9. JDBC
1.9.1. 安装 JDBC 包
1.9.2. MySQL
1.9.3. Oracle
1.9.4. FAQ
1.10. Util
1.10.1. Properties 处理 *.properties 文件
1.10.2. Logging
1.10.3. BASE64
1.10.4. Locale 国际化
1.10.5. ResourceBundle
1.10.6. Scanner
1.10.7. UUID
1.10.8. Arrays.equals 判断两个数组是否相等
1.10.9. Random 随机字符串
1.10.10. ArrayBlockingQueue
1.10.11. CRC32
1.10.12. FutureTask
1.11. IO
1.11.1. 取出文件名中的扩展名
1.11.2. 临时文件
1.11.3. FileWriter 文本写入文件
1.11.4. BufferedWriter
1.11.5. inputStream.transferTo()
1.11.6. InputStreamReader
1.11.7. 获得 Resource 下文件路径
1.11.8. PrintWriter
1.11.9. OutputStreamWriter
1.11.10. FileOutputStream
1.11.11. FileInputStream
1.11.12. Scanner
1.11.13. 二进制文件
1.12. Reflection 反射
1.12.1. 获得所有变量
1.12.2. 批量赋值
1.12.3. 方法操作
1.13. Java 线程
1.13.1. 多线程 Lambda 表达式
1.13.2. 实现异步执行
1.13.3. 继承 Thread 类实现多线程
1.13.4. 实现 Runnable 接口
1.13.5. 线程同步
1.13.6. java 线程池
1.13.7. ThreadLocal
1.13.8. InheritableThreadLocal
1.13.9. CompletableFuture
1.14. java 脚本引擎
1.14.1. Maven
1.14.2. Helloworld
1.14.3. 运行脚本文件
1.14.4. 变量传递
1.14.5. 全局变量与局部变量定义
1.14.6. 调用脚本中的函数或方法
1.14.7. 脚本编译
1.14.8. jjs - Invokes the Nashorn engine.
1.15. Crypto
1.15.1. MD5
1.15.2. AES
1.15.3. AES/CBC/PKCS5PADDING
1.15.4. DES
1.16. java.security
1.16.1. 列出 Java 支持的数字摘要算法
1.16.2. 计算文件的 MD5,SHA 等 HASH 值
2. Build Tools
2.1. Apache Ant
2.1.1. 安装 ant
2.1.2. ANT
2.1.3. Project
2.1.4. path
2.1.5. copy
2.1.6. javac
2.1.7. condition
2.1.8. exec
2.1.9. if
2.1.10. macrodef
2.1.11. Javascript
2.1.12. mail
2.1.13. basename
2.1.14. 创建文件
2.1.15. FAQ
2.2. Apache Ivy
2.2.1. Ivy Install
2.2.2. Test example
2.3. Apache Maven
2.3.1. 安装 Maven
2.3.2. Maven 命令
2.3.3. settings.xml 配置
2.3.4. pom.xml
2.3.5. Maven Module
2.3.6. 依赖管理
2.3.7. plugins
2.3.8. 应用案例
2.4. Gradle 5
2.4.1. 安装 Gradle
2.4.2. Example
2.4.3. gradle 命令
2.4.4. build.gradle
2.4.5. gradle.properties
2.5. JitPack - Easy to use package repository for Git
2.6. Artifactory
2.6.1. Artifactory Web UI
2.6.2. build.gradle
3. Servlet
3.1. Example
3.2. Session
3.3. HttpServletRequest
3.4. Filter
3.4.1. web.xml
3.4.2. Filter 类
3.5. Listener
3.5.1. web.xml
3.5.2. NewsListener 类
3.5.3. NewsTask 类
3.5.4. JSP 中心显示
3.6. JSP
3.6.1. 注释
3.6.2. pageContext
3.6.3. request
3.6.4.
3.6.5. cookie
3.6.6. session
3.6.7. page
3.6.8. trimDirectiveWhitespaces
3.6.9. include
3.6.10. jsp
3.6.11. error-page
3.6.12. JSP 编程
3.6.13. FAQ
3.7. JSTL(JavaServer Pages Standard Tag Library)
3.7.1. c:set
3.7.2. c:out
3.7.3. c:url
3.7.4. c:redirect
3.7.5. c:import
3.7.6. c:if
3.7.7. c:choose
3.7.8. c:forEach
3.7.9. empty 判断是否为空
3.7.10. JSTL fmt Tag setBundle Example
3.8. WebSocket
3.8.1. Server
3.8.2. Client
I. Spring Framework
4. Spring 开发环境
4.1. Java 开发环境
4.2. 安装 Spring Tool Suite
4.3. Dashboard
4.4. Spring Initializr - Bootstrap your application
5. Spring Boot
5.1. Spring Boot Quick start
5.1.1. 创建项目
5.1.2. pom.xml
5.1.3. Controller
5.2. Springboot with Maven
5.2.1. resource
5.2.2. Maven run
5.2.3. Spring Boot maven 插件 build-image
5.2.4. 生成项目信息
5.3. SpringApplication
5.3.1. 运行 Spring boot 项目
5.3.2. @SpringBootApplication
5.3.3. 获取 Resources 目录中的静态文件
5.3.4. @EnableAutoConfiguration
5.3.5. @ComponentScan
5.3.6. @EntityScan 实体扫描
5.3.7. @EnableJpaRepositories
5.3.8. CharacterEncodingFilter
5.3.9. 隐藏 Banner
5.3.10. 实体与仓库扫描
5.3.11. 列出 Beans
5.3.12. Tomcat 端口
5.3.13. 配置项设定
5.3.14. spring.profiles.active
5.3.15. @Profile("dev") / @ActiveProfiles("dev")
5.4. 如何优雅停止 Springboot 运行
5.4.1. 准备工作
5.4.2. kill 命令演示
5.4.3. 容器中如何优雅关闭 Springboot
5.4.4. 写入PID文件
5.5. Properties 配置文件
5.5.1. application.properties 配置文件
5.5.2. Properties 文件
5.5.3. 参数引用
5.5.4. 默认值
5.5.5. 产生随机数
5.5.6. 多行字符串
5.5.7. 注入多值属性 arrays, list, set
5.5.8. containsProperty 读取配置文件
5.5.9. @PropertySource 注解载入 properties 文件
5.5.10. List 列表类型
5.5.11. Map类型
5.5.12. Binder
5.5.13. 加密 application.properties 中的敏感内容
5.6. Spring boot with Logging
5.6.1. 配置日志文件
5.6.2. 打印日志
5.6.3. logback 配置详解
5.6.4. Log4j2 + Gelf + Logstash
5.6.5. 日志报警
5.6.6. Spring boot with ELK(Elasticsearch + Logstash + Kibana)
5.7. Undertow
5.7.1. Maven 依赖
5.7.2. Application
5.7.3. 相关配置
5.8. Spring boot with Jetty
5.9. Spring boot with HTTP2 SSL
5.9.1. 生成自签名证书
5.9.2. application.properties 配置文件
5.9.3. 启动 Spring boot
5.9.4. restTemplate 调用实例
5.9.5. HTTP2
5.10. Spring boot with Webpage
5.10.1. Maven
5.10.2. application.properties
5.10.3. Application
5.10.4. IndexController
5.10.5. src/main/webapp/WEB-INF/jsp/index.jsp
5.10.6. 集成模板引擎
5.11. Spring boot with Velocity template
5.11.1. Maven
5.11.2. Resource
5.11.3. Application
5.11.4. RestController
5.11.5. Test
5.12. Spring boot with Thymeleaf
5.12.1. Maven
5.12.2. application.properties
5.12.3. Controller
5.12.4. HTML5 Template
5.13. Spring boot with Redis
5.13.1. Spring boot with Redis
5.13.2. Redis Pub/Sub
5.14. Spring boot with MongoDB
5.14.1. Maven
5.14.2. Application
5.14.3. MongoTemplate
5.14.4. Repository
5.15. Spring boot with MySQL
5.15.1. Maven
5.15.2. Resource
5.15.3. Application
5.15.4. JdbcTemplate
5.15.5. CrudRepository
5.16. Spring boot with Oracle
5.16.1. Maven
5.16.2. application.properties
5.16.3. Application
5.16.4. CrudRepository
5.16.5. JdbcTemplate
5.16.6. Controller
5.17. Spring boot with PostgreSQL
5.17.1. pom.xml
5.17.2. application.properties
5.17.3. Application
5.17.4. CrudRepository
5.17.5. JdbcTemplate
5.17.6. Controller
5.17.7. Test
5.18. Spring boot with Elasticsearch
5.18.1. Maven
5.18.2. Application
5.18.3. application.properties
5.18.4. Domain
5.18.5. ElasticsearchRepository
5.19. Spring boot with Elasticsearch TransportClient
5.19.1. Maven
5.19.2. Application
5.19.3. application.properties
5.19.4. ElasticsearchConfiguration
5.19.5. RestController
5.20. Spring boot with Apache Hive
5.20.1. Maven
5.20.2. application.properties
5.20.3. Configuration
5.20.4. CURD 操作实例
5.21. Spring boot with Phoenix
5.21.1. Maven
5.21.2. application.properties
5.21.3. Configuration
5.22. Spring boot with Datasource
5.22.1. Master / Slave 主从数据库数据源配置
5.22.2. 多数据源配置
5.22.3. JPA 多数据源
5.23. 连接池配置
5.23.1. org.apache.tomcat.jdbc.pool.DataSource
5.23.2. druid
5.23.3. c3p0 - JDBC3 Connection and Statement Pooling
5.23.4. dbcp2
5.23.5. bonecp
5.23.6. HikariPool
5.24. Spring boot with RabbitMQ(AMQP)
5.24.1. maven
5.24.2. RabbitMQConfig
5.24.3. 生产者
5.24.4. 消费者
5.25. Spring boot with Apache Kafka
5.25.1. 安装 kafka
5.25.2. maven
5.25.3. Spring boot Application
5.25.4. EnableKafka
5.25.5. KafkaListener
5.25.6. 测试
5.25.7. 完整的发布订阅实例
5.25.8. Spring cloud with Kafka
5.26. Spring boot with Scheduling
5.26.1. Application.java
5.26.2. Component
5.26.3. 查看日志
5.26.4. 计划任务控制开关
5.26.5. @Scheduled 详解
5.26.6. Timer 例子
5.26.7. ScheduledExecutorService 例子
5.27. Spring boot with Swagger
5.27.1. Swagger3
5.27.2. Swagger2
5.27.3. @Api()
5.27.4. @ApiOperation()
5.27.5. @ApiResponses
5.27.6. @ApiModel 实体类
5.28. Spring boot with lombok
5.28.1. @Builder
5.28.2. @Slf4j 注解
5.29. Spring boot with Docker
5.29.1. 通过 Docker 命令构建镜像
5.29.2. 通过 Maven 构建 Docker 镜像
5.29.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]
5.29.4. curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:8888
5.30. Spring boot with Docker stack
5.30.1. 编译 Docker 镜像
5.30.2.
5.31. Spring boot with Kubernetes
5.31.1. Kubernetes 编排脚本
5.31.2. 部署镜像
5.32. Spring boot with command line
5.32.1. Maven
5.32.2. CommandLineRunner 例子
5.32.3. ApplicationRunner 例子
5.33. Spring Boot Actuator
5.33.1. Maven 依赖
5.33.2. 与 Spring Boot Actuator 有关的配置
5.33.3. actuator 接口
5.33.4. 健康状态
5.33.5. 关机
5.33.6. info 配置信息
5.33.7. 计划任务
5.33.8. 修改 actuator 地址
5.33.9. metrics
5.33.10. 自定义监控指标
5.34. String boot with RestTemplate
5.34.1. RestTemplate Example
5.34.2. GET 操作
5.34.3. POST 操作
5.34.4. PUT 操作
5.34.5. Delete 操作
5.34.6. 上传文件
5.34.7. HTTP Auth
5.34.8. PKCS12
5.34.9. Timeout 超时设置
5.35. SpringBootTest
5.35.1. Maven 依赖
5.35.2. 测试类
5.35.3.
5.35.4. JPA 测试
5.35.5. TestRestTemplate
5.35.6. Controller单元测试
5.35.7. WebTestClient
5.36. Spring boot with Aop
5.36.1. Aspect
5.37. Spring boot with starter
5.37.1. 实现 starter
5.37.2. 引用 starter
5.38. SpringBoot Admin
5.38.1. 依赖
5.38.2. 启用 Springboot Admin
5.38.3. Nginx 跨域
5.39. Spring boot with Grafana
5.39.1. Springboot 集成 InfluxDB
5.39.2. InfluxDB
5.40. Spring Boot with Prometheus
5.40.1. Maven 依赖
5.40.2. application.properties 配置文件
5.40.3. 启动类
5.40.4. 测试
5.40.5. 控制器监控
5.40.6. 自定义埋点监控
5.41. 设置默认时区
5.42. Spring boot with Git version
5.42.1. CommonRestController 公共控制器
5.42.2. VersionRestController 测试控制器
5.42.3. 创建 .gitattributes 文件
5.43. Spring boot with Session share
5.43.1. Redis
5.43.2. 测试 Session
5.43.3. JDBC
5.43.4. Springboot 2.1
5.44. Spring boot with Caching
5.44.1. maven
5.44.2. 启用 Cache
5.44.3. 测试 Controller
5.44.4. @Cacheable 的用法
5.44.5. @CachePut 用法
5.44.6. 解决Expire 和 TTL 过期时间
5.44.7. SpEL表达式
5.45. Spring boot with Email
5.45.1. Maven
5.45.2. Resource
5.45.3. POJO
5.45.4. RestController
5.45.5. Test
5.46. Spring boot with Hessian
5.46.1. Maven
5.46.2. Application
5.46.3. HessianServiceExporter
5.46.4. Service
5.46.5. RestController
5.47. Spring boot with Async
5.47.1. 启用线程池
5.47.2. 配置线程池
5.47.3. 定义多个线程池
5.47.4. 自定义线程池
5.47.5. 设置线程名称
5.47.6. 线程池监控
5.48. Springboot with Ethereum (web3j)
5.48.1. Maven
5.48.2. application.properties
5.48.3. TestRestController
5.48.4. 测试
5.49. Java Record 新特性
5.49.1. Record 替代 POJO 类
5.49.2. Record 作为 Properties
5.49.3. Record 作为实体类
5.49.4. Record 作为 Service
5.49.5. Record 作为 Controller
5.50. Sprint boot with Redisson
5.50.1. Springboot 3.x
5.50.2. Springboot 2.1
6. Spring MVC
6.1. @EnableWebMvc
6.1.1. CORS 跨域请求
6.1.2. Spring MVC CORS with WebMvcConfigurerAdapter
6.2. @Controller
6.2.1. @RequestMapping
6.2.2. @RequestBody
6.2.3. @RequestHeader - 获取 HTTP Header 信息
6.2.4. RequestMapping with Path Variables - @PathVariable
6.2.5. @ModelAttribute
6.2.6. @ResponseBody
6.2.7. @ResponseStatus 设置 HTTP 状态
6.2.8. @CrossOrigin
6.2.9. @CookieValue - 获取 Cookie 值
6.2.10. @SessionAttributes
6.2.11. ModelAndView
6.2.12. HttpServletRequest / HttpServletResponse
6.3. @RestController
6.3.1. 返回实体
6.3.2. JSON
6.3.3. 处理原始 RAW JSON 数据
6.3.4. 返回 JSON 对象 NULL 专为 "" 字符串
6.3.5. XML
6.3.6. 兼容传统 json 接口
6.3.7. @PageableDefault 分页
6.3.8. 上传文件
6.3.9. Spring boot with csv
6.3.10. Jackson
6.3.11. synchronized
6.4. View
6.4.1. 配置静态文件目录
6.4.2. 添加静态文件目录
6.4.3. Using Spring’s form tag library
6.4.4. Thymeleaf
6.4.5. FreeMarker
6.5. Service
6.5.1. Application
6.5.2. 定义接口
6.5.3. 实现接口
6.5.4. 调用 Service
6.5.5. context.getBean 调用 Service
6.5.6. AopContext
6.6. i18n 国际化
6.6.1. 在 appliction.properties 中配置启用 i18n
6.6.2. 创建语言包文件
6.6.3. 控制器重引用语言包
6.6.4. 参数传递
6.7. 校验器(Validator)
6.7.1. 常规用法
6.7.2. 自定义注解
6.8. Interceptor
6.8.1. WebMvcConfigurerAdapter
6.8.2. HandlerInterceptor
6.9. FAQ
6.9.1. o.s.web.servlet.PageNotFound
6.9.2. HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
6.9.3. 同时使用 Thymeleaf 与 JSP
6.9.4. 排除静态内容
6.9.5. HTTP Status 406
6.9.6. Caused by: java.lang.IllegalArgumentException: Not a managed type: class common.domain.Article
6.9.7. {"error":"unauthorized","error_description":"Full authentication is required to access this resource"}
7. WebFlux framework
7.1. Getting Started
7.1.1. Maven
7.1.2. Application
7.1.3. RestController
7.1.4. 测试
7.2. WebFlux 与 SprintMVC 有什么不同?
7.2.1. 实验程序
7.2.2. 实验结果
7.3. WebFlux Router
7.3.1. Component 原件
7.3.2. 路由配置
7.3.3. Thymeleaf
7.3.4. Webflux Redis
7.3.5. Webflux Mongdb
7.3.6. SSE
7.3.7. Mono/Flux
8. Spring Data
8.1. Spring Data with Redis
8.1.1. 集成 Redis XML 方式
8.1.2. RedisTemplate
8.1.3. Spring Data Redis - Repository Examples
8.2. Spring Data with MongoDB
8.2.1. Example Spring Data MongoDB
8.2.2. MongoDB 多数据源
8.2.3. @Document
8.2.4. MongoRepository
8.2.5. mongoTemplate
8.2.6. GeoJson 反序列化
8.2.7. FAQ
8.3. Spring Data with MySQL
8.3.1. 选择数据库表引擎
8.3.2. 声明实体
8.3.3. 实体继承
8.3.4. Repository
8.3.5. 事务 @Transactional
8.3.6. TransactionTemplate
8.3.7. 锁 @Lock
8.4. EntityManager
8.5. Spring Data with JdbcTemplate
8.5.1. execute
8.5.2. queryForInt
8.5.3. queryForLong
8.5.4. queryForObject
8.5.5. queryForList
8.5.6. queryForMap
8.5.7. query
8.5.8. queryForRowSet
8.5.9. update
8.5.10.
8.5.11. 实例参考
8.6. Spring Data with Elasticsearch
8.6.1. 内嵌 Elasticsearch
8.6.2. 集群模式
8.6.3. Document
8.6.4. Elasticsearch 删除操作
8.6.5. FAQ
8.7. Spring boot with Data restful
8.7.1. Maven
8.8. Apache ShardingSphere
8.8.1. 微服务集群环境,雪花算法出现重复ID
8.9. Spring Data FAQ
8.9.1. No identifier specified for entity
8.9.2. Oracle Date 类型显示日期和时间
8.9.3. java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
8.9.4. Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query
9. Spring Security
9.1. Spring Security with HTTP Auth
9.1.1. 默认配置
9.1.2. 设置用户名和密码
9.1.3. 禁用 Security
9.2. Spring boot with Spring security
9.2.1. Maven
9.2.2. Reource
9.2.3. Application
9.2.4. WebSecurityConfigurer
9.2.5. RestController
9.2.6. 测试
9.2.7. Spring + Security + MongoDB
9.3. Spring Boot with Web Security
9.3.1. EnableWebSecurity
9.3.2. Web静态资源
9.3.3. 正则匹配
9.3.4. 登陆页面,失败页面,登陆中页面
9.3.5. CORS
9.3.6. X-Frame-Options 安全
9.4. 访问控制列表(Access Control List,ACL)
9.4.1. antMatchers
9.4.2. HTTP Auth
9.4.3. Rest
9.4.4. hasRole
9.4.5. hasAnyRole()
9.4.6. withUser
9.5. Spring Authorization Server
9.5.1. Oauth2 协议
9.5.2. Maven 依赖
9.5.3. Spring cloud with Oauth2
10. Spring Cloud
10.1. Spring Cloud 相关的 application.properties 配置
10.1.1. 启用或禁用 bootstrap
10.1.2. bootstrap.properties 配置文件
10.2. Spring Cloud Config
10.2.1. Maven 项目 pom.xml 文件
10.2.2. Server
10.2.3. Client
10.2.4. Config 高级配置
10.2.5. Old
10.3. Spring Cloud Consol
10.3.1. Spring Cloud Consul 配置
10.3.2. Maven 父项目
10.3.3. Consul 服务生产者
10.3.4. Consul 服务消费者
10.3.5. Openfeign
10.4. Spring Cloud Netflix
10.4.1. Eureka Server
10.4.2. Eureka Client
10.4.3. Feign client
10.4.4. 为 Eureka Server 增加用户认证
10.4.5. Eureka 配置项
10.4.6. ribbon
10.4.7. 获取 EurekaClient 信息
10.4.8. Zuul
10.5. Openfeign
10.5.1. Openfeign 扫描包配置
10.5.2. 用户认证
10.5.3. 应用实例
10.5.4. 配置连接方式
10.5.5. 配置手册
10.6. Spring Cloud Gateway
10.6.1. Gateway 例子
10.6.2. 路由配置
10.7. Spring Cloud Stream
10.8. Spring Cloud Bus
10.9. Spring Cloud Sleuth
10.9.1. logback 安装
10.10. Spring Cloud with Kubernetes
10.10.1. Config
10.10.2. 注册发现
10.11. Spring Cloud Alibaba
10.11.1. 安装 Nacos
10.11.2. Kubernetes 部署微服务
10.11.3. Nacos 配置中心/注册中心代码实例
10.11.4. FAQ
10.12. FAQ
10.12.1. Cannot execute request on any known server
10.12.2. @EnableDiscoveryClient与@EnableEurekaClient 区别
10.12.3. Feign请求超时
10.12.4. 已停止的微服务节点注销慢或不注销
10.12.5. Feign 启动出错 PathVariable annotation was empty on param 0.
10.12.6. Feign 提示 Consider defining a bean of type 'common.feign.Cms' in your configuration.
10.12.7. Load balancer does not have available server for client
10.12.8. Eureka Client (Dalston.SR1)
10.12.9. Config Server(1.3.1.RELEASE)
10.12.10. feign.RetryableException: Read timed out executing
11. Tomcat Spring 运行环境
11.1. Maven
11.2. Spring Boot Quick start
11.2.1. 创建项目
11.2.2. pom.xml
11.2.3. Controller
11.3. Spring MVC configuration
11.4. Tomcat
11.5. 集成 Mybatis
11.5.1. pom.xml
11.5.2. properties
11.5.3. dataSource
11.5.4. SqlSessionFactory
11.5.5. Mapper 扫描
11.5.6. Mapper 单一class映射
11.5.7. Service
11.5.8. 测试实例
12. Miscellaneous
12.1. 阿里云 OSS - STS进行临时授权访问获取 HTTPS 地址
13. FAQ
13.1. org.hibernate.dialect.Oracle10gDialect does not support identity key generation
13.2. No identifier specified for entity
13.3. Could not read document: Invalid UTF-8 middle byte 0xd0
13.4. java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
13.5. Field javaMailSender in cn.netkiller.rest.EmailRestController required a bean of type 'org.springframework.mail.javamail.JavaMailSender' that could not be found.
13.6. org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "172.16.0.3", user "test", database "test ", SSL off
13.7. Spring boot 怎样显示执行的SQL语句
13.8. Cannot determine embedded database driver class for database type NONE
13.9. Spring boot / Spring cloud 时区差8个小时
13.10. @Value 取不到值
13.11. Spring boot 2.1.0
13.12. Field authenticationManager in cn.netkiller.oauth2.config.AuthorizationServerConfigurer required a bean of type 'org.springframework.security.authentication.AuthenticationManager' that could not be found.
13.13. 打印 Bean 信息
13.14. The dependencies of some of the beans in the application context form a cycle
13.15. no main manifest attribute, in /srv/job-admin.jar
14. MyBatis
14.1. Mybatis 入门
14.2. 接口注解
15. Apache Struts
15.1. struts.xml
15.1.1. include
15.2. Struts Tags
15.2.1. property
15.2.2. set
15.2.3. url
15.2.4. s:include
15.2.5. s:action
15.2.6. HTML Form
15.2.7. iterator
15.2.8. if elseif else
15.3. Action
15.3.1. redirect
15.3.2. redirectAction
15.3.3. JSON
15.3.4. 传递 Timestamp 变量
15.4. Ajax + JSON
15.4.1. GET/POST JSON
15.5. Json 内容展示
15.5.1. 禁止方法
15.5.2. 格式化日期
15.5.3. 重命名变量名
15.5.4. org.apache.struts2.json
15.6. Interceptor
15.6.1. Session
15.7. Action 中使用线程
15.8. 日志
15.9. FAQ
15.9.1. Struts 怎样判断用户来自电脑还是移动设备
16. Apache Tiles
16.1. 配置 Tiles
16.1.1. Maven
16.1.2. web.xml
16.2. Template 配置模板
16.3. Struts tiles
17. Play
18. Log
18.1. Logback
18.1.1. Maven 包
18.1.2. Example
18.2. slf4j
18.3. log4j
18.3.1. 安装 Log4j
18.3.2. log4j 环境变量
18.3.3. Log4j Example
18.3.4. log4j.properties
19. JSON (JavaScript Object Notation)
19.1. javax.json.*
19.1.1. Json 编码
19.1.2. Json 解码
19.1.3. URL获取Json
19.2. Jackson
19.2.1. ObjectToJSON
19.2.2. JSONToObject
19.2.3. JsonNode
20. AMQP(Advanced Message Queuing Protocol)
20.1. Send and Recv
20.2. direct
21. NoSQL
21.1. MongoDB
21.1.1. pom.xml
21.1.2. 插入操作
21.1.3. 读取操作
22. Elasticsearch API
22.1. Client
22.2. insert
22.3. Get
22.4. delete
22.5. Search
22.6. Query 查询
22.6.1. match all 匹配所有数据
22.6.2. match 匹配查询
22.6.3. match phrase 短语精准匹配
22.7. Filter 过滤
22.7.1. term
22.7.2. range
22.8. Sorting
22.9. 返回 Source 字段
22.10. Count
22.11. Example 范例
22.11.1. Spring boot 案例
22.12. FAQ
22.12.1. 显示查询 JSON 字符串
23. Jersey - RESTful Web Services in Java.
23.1. Client 2.x
23.1.1. Maven 版本
23.1.2. GET 操作
23.1.3. GET + Auth 用户认证
23.2. Client 1.x
23.2.1. Jersey + Auth + HTTP2 + SSL
24. Apache HttpComponents
24.1. org.apache.commons.lang3
24.1.1. HTML 标签处理
24.1.2. StringUtils.join 使用特定字符链接字符串
24.1.3. RandomStringUtils
24.2. commons-text
24.2.1. 禁止转译 json
24.3. Apache HttpClient
24.3.1. Maven
24.3.2. HTTP POST 操作
24.3.3. HTTPS
24.3.4. HTTP/2
24.3.5. Java11
24.3.6. Host name 'api.netkiller.cn' does not match the certificate subject provided
24.3.7. HttpStatus
25. Cache
25.1. java memcached client
25.2. Jedis
25.2.1. 认证
25.2.2. jedis.keys
25.3. Ehcache
26. Kafka
26.1. 安装 Kafka 环境
26.2. Maven
26.3. 启动 kafka
26.4. 入门例子
26.4.1. 订阅例子
26.4.2. 发布例子
26.5. 线程例子
27. Software Development Kit
27.1. Google
27.1.1. com.google.gson
27.1.2. Guava
27.2. Mahout
27.2.1. 推荐系统
27.3. Hessian
27.4. quartz-scheduler
27.5. Redisson
II. Android 9 Pie
28. Android Studio
28.1. 卸载 Android Studio
28.2. 代码格式化
28.3. 设置兼容最低SDK版本
28.4. SDK Tools
28.4.1. 接受 License
28.4.2. 查看 SDK 列表
28.4.3. 按照 Android SDK
28.5. 命令行操作
29. AndroidManifest.xml
29.1.
29.2. 开启网络
29.3. 文件存储权限
29.4. 相机权限
29.5. GPS 定位权限
30. 配置文件
30.1. *.properties 文件
30.2. 再 AndroidManifest.xml 使用 meta-data element 定义
30.3. 再 build.gradle 文件中配置 productFlavors
31. UI Layout
31.1. 切换UI
31.1.1.
31.1.2. startActivity()
31.1.3. Activity 间数据传递
31.2. Button
31.2.1. 启用禁用
31.2.2. 实现 OnClickListener 接口
31.3. ListView
31.3.1. Array
31.3.2. List
31.3.3. setOnItemClickListener()
31.3.4. 用接口方法实现
31.4. Switch
31.5. GardView
31.6. GridView
31.7. ProgressBar
31.8. ImageView
31.9. Fragment
31.10. Dialog
31.11. Menu
32. Toast
32.1. 默认样式
32.2. 自定义样式
32.3. 带有图片的样式
33. Environment
33.1.
33.2.
33.3.
34. Schedule 计划任务
34.1. Time 和 TimerTask 定时刷新
34.2. 使用 Runnable 和 Handler 实现定时执行
35. Internationalization i18n with Android (国际化)
35.1. 创建国际化文件
35.2. strings.xml 文件
35.3. 翻译语言
35.4. 引用国际化文件
35.5. 切换语言
36. 存储
36.1. SharedPreferences
36.1.1. 操作模式
36.1.2. 保存数据
36.1.3. 读取数据
36.1.4. 通过 key 查询数据是否存在
36.1.5. 删除数据
36.1.6. 清空数据
36.1.7. 对象存储
36.1.8. SharedPreferences 读取物理存储文件
36.2. SD Card
36.2.1. SD Card 状态
37. 相机与相册
37.1. manifest 文件
37.2. layout
37.3. Activity
37.4. LED flash 做手电筒
38. 麦克风与录音
38.1. 开启麦克风和SD卡权限
38.2. layout
38.3. Activity
39. 多媒体开发
39.1. MediaPlayer
39.2. VideoView 开发
39.2.1. 播放网络视频
39.2.2. MediaController 添加翻页事件
39.2.3. 静音播放视频
39.2.4. 更新进度条
39.2.5. 完整的例子
39.3. SurfaceView
39.4. Vitamio
40. 定位
40.1. manifest 权限配置
40.2. layout
40.3. Activity
41. 电话
41.1. SIM 卡状态
41.2. 通信录与拨打电话
41.3.
42. 消息广播
42.1. 动态注册
42.2. 静态注册
42.3. 自定义用户消息广播
42.4. 本地广播
43. Service
43.1. Service的基本用法
43.1.1. manifest 文件
43.1.2. 创建 Service
43.1.3. Layout 代码
43.1.4. Activity 代码
43.2. Service 中启动线程
43.3. Service和Activity通信
43.3.1. Layout
43.3.2. Service
43.3.3. Activity
44. NFC (Near field communication)
44.1. AndroidManifest.xml 文件配置
44.2. Loyout 文件
44.3. Activity 文件
45. OkHttp - An HTTP & HTTP/2 client for Android and Java applications
45.1. Gradle
45.2. AndroidManifest.xml 开启网络访问权限
45.3. okhttp 默认是 HTTPS 开启 HTTP
45.4. GET
45.5. POST
45.5.1. POST Form Data
45.5.2. POST RAW JSON
45.5.3. 数据流提交
45.6. http header 相关设置
45.6.1. 设置 HTTP 头
45.6.2. Cookie 管理
45.6.3. 禁用缓存
45.6.4. 设置缓存 max-age
45.6.5. 强制缓存
45.7. HTTP Base Auth
45.8. HttpUrl.Builder 组装 URL 地址参数
45.9. Android Activity Example
45.10. Android Oauth2 + Jwt example
45.11. HTTP/2
46. EventBus
46.1. 添加 EventBus 依赖到项目Gradle文件
46.2. 快速开始一个演示例子
46.2.1. 创建 MessageEvent 类
46.2.2. Layout
46.2.3. Activity
46.3. Sticky Events
46.3.1. MainActivity
46.3.2. StickyActivity
46.3.3. MessageEvent
46.3.4. 删除粘性事件
46.4. 线程模型
46.5. 配置 EventBus
46.6. 事件优先级
46.7. 捕获异常事件
47. 设计模式
47.1. 单例模式
48.
48.1. java.net.UnknownServiceException: CLEARTEXT communication to 192.168.0.185 not permitted by network security policy
48.2. Caused by: android.os.NetworkOnMainThreadException
1. 附录
1.1. 一致性算法

范例清单

1.1. /etc/profile.d/java.sh
2.1. Maven properties
2.2. 将本地 lib/*.jar 包添加到项目中
2.3. 将本地 src/resources 打包到项目
2.4. Maven parent
2.5. watir-webdriver example
5.1. Spring boot with Velocity template (pom.xml)
5.2. RedisTemplate
5.3. Example Spring boot with Oracle
5.4. Spring boot with Apache kafka.
5.5. Spring boot with Apache kafka.
5.6. Test Spring Kafka
5.7. Spring boot with Email (pom.xml)
8.1. Spring Data Redis Example
8.2. Spring Data MongoDB - springframework-servlet.xml
10.1. Share feign interface.
11.1. MyBatis
25.1. memcached.java