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

部分 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. HttpServletRequest / HttpServletResponse
66.3. @RestController
66.3.1. 返回迭代器
66.3.2. 上传文件
66.3.3. 返回实体
66.3.4. JSON
66.3.5. 处理原始 RAW JSON 数据
66.3.6. 返回 JSON 对象 NULL 专为 "" 字符串
66.3.7. XML
66.3.8. 兼容传统 json 接口
66.3.9. 上传文件
66.3.10. Spring boot with csv
66.3.11. Json 处理
66.3.12. synchronized
66.3.13. Spring boot with Emitter
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. 校验器(Validator)
66.5.1. 常规用法
66.5.2. 自定义注解
66.6. Interceptor/Filter 拦截器/过滤
66.6.1. Session 拦截
66.6.2. Token 拦截
66.6.3. 过滤器
66.6.4. 拦截器获取PathVariable变量
66.7. String boot with RestTemplate
66.7.1. RestTemplate Example
66.7.2. GET 操作
66.7.3. POST 操作
66.7.4. PUT 操作
66.7.5. Delete 操作
66.7.6. 上传文件
66.7.7. HTTP Auth
66.7.8. PKCS12
66.7.9. Timeout 超时设置
66.8. RestClient
66.8.1. 创建 RestClient
66.8.2. Get 操作
66.8.3. Post Json
66.8.4. HTTP Authorization Basic
66.8.5. onStatus
66.8.6. 下载二进制流
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. WebClient
68.12.1. 配置 WebClient
68.12.2. @Controller/@RestController 实例
68.12.3. Get 请求实例
68.12.4. URI 参数
68.12.5. 查询参数
68.12.6. Post 操作演示
68.12.7. Post 表单数据
68.12.8. 上传文件
68.12.9. 设置 HTTP 头
68.12.10. 同步阻塞等待返回结果
68.12.11. websocket
68.12.12. 获取 HTTP 链接状态
68.12.13. Http Base Authentication - 401 Unauthorized
68.12.14. 订阅 SSE
68.12.15. 超时时间
68.12.16. share() 共享订阅数据
68.12.17. 打印调试日志
68.12.18. org.springframework.web.context.request.async.AsyncRequestNotUsableException: ServletOutputStream failed to flush: java.io.IOException: Broken pipe
68.13. Webflux 安全
68.13.1. Token 拦截器
68.13.2. JWT
68.13.3. spring-boot-starter-security
68.14. 常见问题
68.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.
68.14.2. @EnableWebFluxSecurity 与 @EnableReactiveMethodSecurity 不生效
68.14.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. Spring boot with Webpage
70.1. Maven
70.2. application.properties
70.3. Application
70.4. IndexController
70.5. src/main/webapp/WEB-INF/jsp/index.jsp
70.6. 集成模板引擎
71. Spring boot with Velocity template
71.1. Maven
71.2. Resource
71.3. Application
71.4. RestController
71.5. Test
72. Spring boot with Thymeleaf
72.1. Maven
72.2. application.properties
72.3. Controller
72.4. HTML5 Template
73. Tomcat Spring 运行环境
73.1. Maven
73.2. Spring MVC configuration
73.3. Tomcat
73.4. 集成 Mybatis
73.4.1. pom.xml
73.4.2. properties
73.4.3. dataSource
73.4.4. SqlSessionFactory
73.4.5. Mapper 扫描
73.4.6. Mapper 单一class映射
73.4.7. Service
73.4.8. 测试实例