Spring Web MVC4

来源:互联网 发布:数车的caxa编程 编辑:程序博客网 时间:2024/06/05 05:53

数据绑定流程

DataBinder

  • 获取请求参数
    1.接受普通请求参数
    2.HttpServletRequest
    3.使用@RequestParam注解获取参数
    4.使用@RequestBody获取JSON参数
    5.使用@PathVariable获取URL传递参数
    6.自动封装成POJO

  • 传递响应参数
    1.HttpServletRequestSession
    2.@RequestAttribute
    3.@SessionAttribute
    4.@SessionAttributes
    2.ModelAndView
    3.ModelMap
    4.@ModelAttribute


原创粉丝点击