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

部分 II. Spring Framework

目录

40. Spring 框架
40.1. @Bean
40.1.1. @Scope 定义类型
40.1.2. InitializingBean
40.2. URL 拼装/解析
40.3. ServletUriComponentsBuilder
40.4. URL 路径相关
41. Spring MVC
41.1. @EnableWebMvc
41.1.1. CORS 跨域请求
41.1.2. Spring MVC CORS with WebMvcConfigurerAdapter
41.2. @Controller
41.2.1. @RequestMapping
41.2.2. @GetMapping
41.2.3. @PostMapping
41.2.4. @RequestBody
41.2.5. RequestMapping with Request Parameters - @RequestParam
41.2.6. @RequestHeader - 获取 HTTP Header 信息
41.2.7. RequestMapping with Path Variables - @PathVariable
41.2.8. @MatrixVariable注解,RFC3986定义URI的路径(Path)中可包含name-value片段
41.2.9. @ModelAttribute
41.2.10. @ResponseBody
41.2.11. @ResponseStatus 设置 HTTP 状态
41.2.12. @CrossOrigin
41.2.13. @CookieValue - 获取 Cookie 值
41.2.14. @SessionAttributes
41.2.15. ModelAndView
41.2.16. HttpServletRequest / HttpServletResponse
41.2.17. StreamingResponseBody 输出 Raw Data
41.3. @RestController
41.3.1. 返回迭代器
41.3.2. 上传文件
41.3.3. 返回实体
41.3.4. JSON
41.3.5. 处理原始 RAW JSON 数据
41.3.6. 返回 JSON 对象 NULL 专为 "" 字符串
41.3.7. XML
41.3.8. 兼容传统 json 接口
41.3.9. 上传文件
41.3.10. Spring boot with csv
41.3.11. Json 处理
41.3.12. synchronized
41.3.13. SSE Streaming in Spring MVC
41.3.14. StreamingResponseBody
41.4. View
41.4.1. 配置静态文件目录
41.4.2. 添加静态文件目录
41.4.3. Using Spring’s form tag library
41.4.4. Thymeleaf
41.4.5. FreeMarker
41.4.6. i18n 国际化
41.5. 校验器(Validator)
41.5.1. 常规用法
41.5.2. 自定义注解
41.6. Interceptor/Filter 拦截器/过滤
41.6.1. Session 拦截
41.6.2. Token 拦截
41.6.3. 过滤器
41.6.4. 拦截器获取PathVariable变量
41.7. String boot with RestTemplate
41.7.1. RestTemplate Example
41.7.2. GET 操作
41.7.3. POST 操作
41.7.4. PUT 操作
41.7.5. Delete 操作
41.7.6. 上传文件
41.7.7. HTTP Auth
41.7.8. PKCS12
41.7.9. Timeout 超时设置
41.8. RestClient
41.8.1. 创建 RestClient
41.8.2. Get 操作
41.8.3. Post Json
41.8.4. HTTP Authorization Basic
41.8.5. onStatus
41.8.6. 下载二进制流
43. WebFlux framework
43.1. Getting Started
43.1.1. Maven
43.1.2. Application
43.1.3. RestController
43.1.4. 测试
43.2. WebFlux 与 SprintMVC 有什么不同?
43.2.1. 实验程序
43.2.2. 实验结果
43.3. WebFlux Router
43.3.1. Component 原件
43.3.2. 路由配置
43.4. RestController
43.4.1. Post 数据
43.4.2. Thymeleaf
43.5. Webflux Redis
43.5.1. Maven Redis 依赖
43.5.2. Redis 配置
43.5.3. Config
43.5.4. Service
43.5.5.
43.6. Webflux Mongdb
43.6.1. Maven 依赖
43.6.2. Repository
43.6.3. Service
43.6.4. 控制器
43.7. Mono
43.7.1. Mono.just()/Mono.justOrEmpty()
43.7.2. MonoSink 创建 Mono
43.7.3. Supplier 创建 Mono
43.7.4. then()
43.7.5. 异常处理
43.7.6. 同步阻塞等待结果
43.8. Flux 返回多条数据
43.8.1. FluxSink 创建异步 Flux
43.8.2. SynchronousSink 创建同步 Flux
43.8.3. just()
43.8.4. 从 Flux/Mono 创建 Flux
43.8.5. 消息订阅
43.8.6. 从 Flux/Mono 创建 Flux
43.8.7. 从 Iterable 创建 Flux
43.8.8. 从 Stream 创建 Flux
43.8.9. defer()
43.8.10. Flux.interval()
43.8.11. Flux.empty()
43.8.12. Flux.error()
43.8.13. Flux.never()
43.8.14. Flux.range()
43.8.15. 返回数据
43.8.16. 持续更新 Flux
43.8.17. map(), flatMap()
43.8.18. 过滤
43.8.19. 触发操作
43.9. SSE
43.9.1. 一次性事件
43.9.2. 从 Steam 返回数据
43.9.3. 周期性事件
43.9.4. 返回 ServerSentEvent 数据结构
43.9.5. SSE 完整的例子
43.9.6. SSE Client 订阅实例
43.10. 并发
43.11. ConnectableFlux
43.12. WebClient
43.12.1. 配置 WebClient
43.12.2. @Controller/@RestController 实例
43.12.3. Get 请求实例
43.12.4. URI 参数
43.12.5. 查询参数
43.12.6. Post 操作演示
43.12.7. Post 表单数据
43.12.8. 上传文件
43.12.9. 设置 HTTP 头
43.12.10. 同步阻塞等待返回结果
43.12.11. websocket
43.12.12. 获取 HTTP 链接状态
43.12.13. Http Base Authentication - 401 Unauthorized
43.12.14. 订阅 SSE
43.12.15. 超时时间
43.12.16. share() 共享订阅数据
43.12.17. 打印调试日志
43.13. Webflux 安全
43.13.1. Token 拦截器
43.13.2. JWT
43.13.3. spring-boot-starter-security
43.14. 常见问题
43.14.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.
43.14.2. @EnableWebFluxSecurity 与 @EnableReactiveMethodSecurity 不生效
43.14.3. webflux netty 不支持 Content-Type: application/x-www-form-urlencoded
44. Service
44.1. Application
44.2. 定义接口
44.3. 实现接口
44.4. 调用 Service
44.5. context.getBean 调用 Service
44.6. AopContext
44.7. Service 单例/多例模式
44.7.1. Service 是单例模式
44.7.2. Service 多例实现
44.8. 构造方法
45. Spring boot with Webpage
45.1. Maven
45.2. application.properties
45.3. Application
45.4. IndexController
45.5. src/main/webapp/WEB-INF/jsp/index.jsp
45.6. 集成模板引擎
46. Spring boot with Velocity template
46.1. Maven
46.2. Resource
46.3. Application
46.4. RestController
46.5. Test
47. Spring boot with Thymeleaf
47.1. Maven
47.2. application.properties
47.3. Controller
47.4. HTML5 Template
48. Tomcat Spring 运行环境
48.1. Maven
48.2. Spring MVC configuration
48.3. Tomcat
48.4. 集成 Mybatis
48.4.1. pom.xml
48.4.2. properties
48.4.3. dataSource
48.4.4. SqlSessionFactory
48.4.5. Mapper 扫描
48.4.6. Mapper 单一class映射
48.4.7. Service
48.4.8. 测试实例