Skip to content

Spring MVC 接收参数的方式

1. @RequestBody

POST 参数

java
@RequestMapping(value = "/Search", method = RequestMethod.POST)
public final List<Model> Search(@RequestBody SearchCondition condition) {

}

2. @PathVariable

URL 中的参数 @RequestMapping 参数中需要使用占位符

java
@RequestMapping(value = "/Search/{key}", method = RequestMethod.GET)
public final Result Search(@PathVariable String key) {

}

3. @RequestParam

接收 PostBody 中或者 Url 中的 QueryString

java
@RequestMapping(value = "/Search", method = RequestMethod.POST)
public final Result Search(@RequestParam("key") String key) {

}

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.