Special Bean Types
-
HandlerExceptionResolver:解析异常并可能将其映射到处理程序或错误视图。
-
ViewResolver:将逻辑视图名称解析为实际视图以进行呈现。
-
LocaleResolver:确定客户所在的语言区域和时区。
-
ThemeResolver:确定应用程序使用的主题。
-
MultipartResolver:解析多部分请求,例如表单文件上传。
-
FlashMapManager:存储和检索用于在请求之间传递属性的 FlashMap。
DispatcherServlet
委托给特殊 Bean 来处理请求并呈现适当的响应。“特殊 Bean”是指实现框架契约的由 Spring 管理的 Object
实例。这些通常带有内置契约,但您可以自定义它们的属性并扩展或替换它们。
The DispatcherServlet
delegates to special beans to process requests and render the
appropriate responses. By “special beans” we mean Spring-managed Object
instances that
implement framework contracts. Those usually come with built-in contracts, but
you can customize their properties and extend or replace them.
下表列出了 DispatcherServlet
检测到的特殊 Bean:
The following table lists the special beans detected by the DispatcherServlet
:
Bean type | Explanation |
---|---|
|
Map a request to a handler along with a list of
interceptors for pre- and post-processing.
The mapping is based on some criteria, the details of which vary by The two main |
|
Help the |
Strategy to resolve exceptions, possibly mapping them to handlers, to HTML error views, or other targets. See Exceptions. |
|
Resolve logical |
|
Resolve the |
|
Resolve themes your web application can use — for example, to offer personalized layouts. See Themes. |
|
Abstraction for parsing a multi-part request (for example, browser form file upload) with the help of some multipart parsing library. See Multipart Resolver. |
|
Store and retrieve the “input” and the “output” |