Skip to content

Commit a4bd06a

Browse files
committed
Update 11.3.1. The @RestController and @RequestMapping annotations.md
1 parent d2449a5 commit a4bd06a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

II. Getting started/11.3.1. The @RestController and @RequestMapping annotations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
### 11.3.1. @RestController@RequestMapping注解
33

4-
我们的`Example`类上使用的第一个注解是`@RestController`。这被称为一个构造型(stereotype)注解。它为阅读代码的人们提供建议。对于Spring,该类扮演了一个特殊角色。在本示例中,我们的类是一个web `@Controller`,所以当处理进来的web请求时,Spring会询问它。
4+
我们的Example类上使用的第一个注解是`@RestController`。这被称为一个构造型(stereotype)注解。它为阅读代码的人们提供建议。对于Spring,该类扮演了一个特殊角色。在本示例中,我们的类是一个web `@Controller`,所以当处理进来的web请求时,Spring会询问它。
55

66
`@RequestMapping`注解提供路由信息。它告诉Spring任何来自"/"路径的HTTP请求都应该被映射到`home`方法。`@RestController`注解告诉Spring以字符串的形式渲染结果,并直接返回给调用者。
77

0 commit comments

Comments
 (0)