瀏覽代碼

Clarify required=false

Dave Syer 9 年之前
父節點
當前提交
523b29d345
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      README.adoc

+ 1
- 1
README.adoc 查看文件

@@ -107,7 +107,7 @@ The `@RequestMapping` annotation ensures that HTTP requests to `/greeting` are m
107 107
 
108 108
 NOTE: The above example does not specify `GET` vs. `PUT`, `POST`, and so forth, because `@RequestMapping` maps all HTTP operations by default. Use `@RequestMapping(method=GET)` to narrow this mapping.
109 109
 
110
-`@RequestParam` binds the value of the query string parameter `name` into the `name` parameter of the `greeting()` method. This query string parameter is not `required`; if it is absent in the request, the `defaultValue` of "World" is used.
110
+`@RequestParam` binds the value of the query string parameter `name` into the `name` parameter of the `greeting()` method. This query string parameter is optional (`required=false` by default): if it is absent in the request, the `defaultValue` of "World" is used.
111 111
 
112 112
 The implementation of the method body creates and returns a new `Greeting` object with `id` and `content` attributes based on the next value from the `counter`, and formats the given `name` by using the greeting `template`.
113 113