Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
e14f42f3
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e14f42f3
编写于
1月 25, 2016
作者:
R
Rossen Stoyanchev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update reference for HTTP HEAD and OPTIONS support
Issue: SPR-13130
上级
135738f9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
2 deletion
+23
-2
src/asciidoc/web-mvc.adoc
src/asciidoc/web-mvc.adoc
+21
-1
src/asciidoc/whats-new.adoc
src/asciidoc/whats-new.adoc
+2
-1
未找到文件。
src/asciidoc/web-mvc.adoc
浏览文件 @
e14f42f3
...
...
@@ -590,7 +590,7 @@ are relative to the `/appointments` path. The `get()` method has a further
requests for `appointments/new` are handled by that method.
The `getForDay()` method shows another usage of `@RequestMapping`: URI templates. (See
<
<
mvc-ann-requestmapping-uri-templates
,
the
next
section
>
>).
<
<
mvc-ann-requestmapping-uri-templates
>
>).
A `@RequestMapping` on the class level is not required. Without it, all paths are simply
absolute, and not relative. The following example from the __PetClinic__ sample
...
...
@@ -1162,6 +1162,26 @@ respectively instead. They are intended specifically for that purpose.
====
[[mvc-ann-requestmapping-head-options]]
==== HTTP HEAD and HTTP OPTIONS
`@RequestMapping` methods mapped to "GET" are also implicitly mapped to "HEAD",
i.e. there is no need to have "HEAD" explicitly declared. An HTTP HEAD request
is processed as if it was an HTTP GET except instead of writing the body only
the number of bytes are counted and the "Content-Length" header set.
`@RequestMapping` method have built-in support for HTTP OPTIONS. By default an
HTTP OPTIONS request is handled by setting the "Allow" response header to the
HTTP methods explicitly declared on all `@RequestMapping` methods with matching
URL patterns. When no HTTP methods are explicitly declared the "Allow" header
is set to "GET,HEAD". Therefore it's highly recommended to always explicitly
declare the HTTP method(s) an `@RequestMapping` method is meant to handle.
Although not necessary an `@RequestMapping` method can be mapped to and handle
either HTTP HEAD or HTTP OPTIONS, or both.
[[mvc-ann-methods]]
=== Defining @RequestMapping handler methods
...
...
src/asciidoc/whats-new.adoc
浏览文件 @
e14f42f3
...
...
@@ -661,8 +661,9 @@ Spring 4.3 also improves the caching abstraction as follows:
=== Web Improvements
* Built-in support for <<mvc-ann-requestmapping-head-options,HTTP HEAD and HTTP OPTIONS>>.
* New `@RestControllerAdvice` annotation combines `@ControllerAdvice` with `@ResponseBody`.
* `@ResponseStatus` can be used on a controller type is inherited for all method.
* `@ResponseStatus` can be used on a controller type
and
is inherited for all method.
* `AsyncRestTemplate` supports request interception.
=== WebSocket Messaging Improvements
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录