SpringMVC 常用注解

@requestMapping

用于请求 url 映射。

 

@RequestBody

注解实现接收 http 请求的 json 数据,将 json 数据转换为 java 对象。

 

@ResponseBody

注解实现将 controller 方法返回对象转化为 json 响应给客户。

 

@RequestMapping 

绑定机制 key:value 格式的数据 

SpringMVC的参数绑定过程是把表单提交的请求参数,作为控制器中方法的参数进行绑定

posted @ 2022-08-24 12:02  SuRussia  阅读(20)  评论(0)    收藏  举报