@pathVariable

注解:@pathVariable("pageSize")
说明:需要配合rest风格url使用,目的是接收rest Url中的参数
例如:http://127.0.0.1:8082/hello/4
代码示例:
@RequestMapping(value = "/hello/{pageSize}", method = RequestMethod.GET)
    public String say(@PathVariable("pageSize") String pageSize) {
        return pageSize;
    }

@RequestParam

注解:@RequestParam((value = "pageSize", required = false, defaultValue = "10"))
说明:接收普通,?后面携带的参数
例如:http://127.0.0.1:8082/hello?pageSize=4
代码示例:
@RequestMapping(value = "/hello", method = RequestMethod.GET)
 public String say2(@RequestParam(value = "pageSize", required = false, defaultValue = "10") 
                    String pageSize) {
        return pageSize;
    }