1.@PathValue一般用于restfull风格
http://localhost:8080/member/SelectUserByids/1/2
如上连接,在后台则为
@RequestMapping("/SelectUserByids/{pageNum}/{pageSize}")
public JSONObject selectUser(@PathValue int pageNum,@PathValue int pageSize){
}
2.@ResuestParam用于普通请求,获取问号之后的变量值
http://localhost:8080/member/SelectUserByids?pageNum=1&pageSize=2
@RequestMapping("/SelectUserByids")
public JSONObject selectUser(@ResuestParam int pageNum,@ResuestParam int pageSize){
}
3.在post请求中,@PathValue 与@ResuestParam都可以接收url中的变量值,@RequstBody来接收请求体的json