示例和指南(从这里开始)
要开始使用 Spring Session,最好的起点是我们的示例应用程序。
表 1. 使用 Spring Boot 的示例应用程序
源 | 描述 | 指南 |
---|---|---|
HttpSession with Redis | 演示如何使用 Spring Session 通过 Redis 替换 HttpSession 。 | HttpSession with Redis Guide |
HttpSession with JDBC | 演示如何使用 Spring Session 通过关系型数据库存储替换 HttpSession 。 | HttpSession with JDBC Guide |
HttpSession with Hazelcast | 演示如何使用 Spring Session 通过 Hazelcast 替换 HttpSession 。 | |
Find by Username | 演示如何使用 Spring Session 通过用户名查找会话。 | Find by Username Guide |
WebSockets | 演示如何在 WebSockets 中使用 Spring Session。 | WebSockets Guide |
WebFlux | 演示如何使用 Spring Session 通过 Redis 替换 Spring WebFlux 的 WebSession 。 | |
WebFlux with Custom Cookie | 演示如何在基于 WebFlux 的应用程序中使用 Spring Session 自定义会话 cookie。 | WebFlux with Custom Cookie Guide |
HttpSession with Redis JSON serialization | 演示如何使用 Spring Session 通过 JSON 序列化将 HttpSession 替换为 Redis。 | |
Spring Session with MongoDB Repositories (servlet-based) | 演示如何使用传统的 MongoDB 仓库支持 Spring Session。 | Spring Session with MongoDB Repositories |
Spring Session with MongoDB Repositories (reactive) | 演示如何使用响应式的 MongoDB 仓库支持 Spring Session。 | Spring Session with MongoDB Repositories |
表 2. 使用基于 Spring Java 的配置的示例应用程序
源 | 描述 | 指南 |
---|---|---|
HttpSession with Redis | 演示如何使用 Spring Session 通过 Redis 替换 HttpSession 。 | HttpSession with Redis Guide |
HttpSession with JDBC | 演示如何使用 Spring Session 通过关系型数据库存储替换 HttpSession 。 | HttpSession with JDBC Guide |
HttpSession with Hazelcast | 演示如何使用 Spring Session 通过 Hazelcast 替换 HttpSession 。 | HttpSession with Hazelcast Guide |
Custom Cookie | 演示如何使用 Spring Session 并自定义 cookie。 | Custom Cookie Guide |
Spring Security | 演示如何在现有的 Spring Security 应用程序中使用 Spring Session。 | Spring Security Guide |
REST | 演示如何在 REST 应用程序中使用 Spring Session 以支持通过 header 进行身份验证。 | REST Guide |
表 3. 使用基于 Spring XML 配置的示例应用程序
Source | 描述 | 指南 |
---|---|---|
HttpSession with Redis | 演示如何使用 Spring Session 将 HttpSession 替换为 Redis 存储。 | HttpSession with Redis 指南 |
HttpSession with JDBC | 演示如何使用 Spring Session 将 HttpSession 替换为关系型数据库存储。 | HttpSession with JDBC 指南 |
表 4. 其他示例应用程序
源代码 | 描述 | 指南 |
---|---|---|
Hazelcast | 演示如何在 Java EE 应用程序中使用 Hazelcast 与 Spring Session。 |
章节摘要
🗃️ Boot Samples
3 个项目
🗃️ WebFlux
2 个项目
🗃️ Java 配置
6 个项目
🗃️ XML 配置
2 个项目