# 9.6　小结

对于许多应用而言，安全性都是非常重要的切面。Spring Security 提供了一种简单、灵活且强大的机制来保护我们的应用程序。

借助于一系列 Servlet Filter，Spring Security 能够控制对 Web 资源的访问，包括 Spring MVC 控制器。借助于 Spring Security 的 Java 配置模型，我们不必直接处理 Filter，能够非常简洁地声明 Web 安全性功能。

当认证用户时，Spring Security 提供了多种选项。我们探讨了如何基于内存用户库、关系型数据库和 LDAP 目录服务器来配置认证功能。如果这些可选方案无法满足认证需求的话，我们还学习了如何创建和配置自定义的用户服务。

在前面的几章中，我们看到了如何将 Spring 运用到应用程序的前端。在接下来的章中，我们将会继续深入这个技术栈，学习 Spring 如何在后端发挥作用，下一章将会首先从 Spring 的 JDBC 抽象开始。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://potoyang.gitbook.io/spring-in-action-v4/untitled-3/untitled.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
