• springmvc


    参数封装:

    命令控制器

    request预处理

    inibinder

    注解开发

    requestMapping(“hello”)

    requestMapping(“/hello.do”)

    requestMapping(value=”/hello.do”)

    requestMapping(value=”/hello.do”,method=RequestMethod.GET)

    requestMapping(value=”/hello.do”,method=RequestMethod.POST)

    浏览器直接访问,a标签都是get请求

    表单提交(指定post)ajax指定post提交,post提交。

    requestMapping(value=”/hello.do”,method={RequestMethod.POST, RequestMethod.GET})

     RequestMaping根路径

    @RequestMapping”/user”

    UserController

    requestMapping(“save”)

    Save()

    requestMapping(“update”)

    Update{}

    requestMapping(“find”)

    Fiind()

    项目名/user/save.do

    @RequestMapping”/items”

    ItemsController

    requestMapping(“save”)

    Save()

    requestMapping(“update”)

    Update{}

    requestMapping(“find”)

    Fiind()

    项目/items/save.do

    参数封装

    分析接受参数类型:

    基本类型,intString等等基本类型。

    Pojo类型

    包装类型 

    数组类型

    Springmvc默认支持类型:

    HttpSessionHttpRequstServletModel等等

    springmvc中没有成员变量

    所以当请求与页面时这个方法内对象会被自动创建和输入参数

    但是要求前端表单元素name和输入参数名称相同

    传list集合

    后端使用包装类:

    userCustom

    private user user

    private List<User> userList;

    private Map<K,V> maps;

    private items items;

    传map

     参数回显

    URL模板映射

    restfull

  • 相关阅读:
    策略模式
    装饰模式VS代理模式
    BufferedInputSream实现原理
    从字节码角度分析重载与重写
    函数sprintf真好用
    算法时间复杂度
    二项分布(Binomial Distribution)
    numpy中的tile函数
    图像缩放算法(最临近点插值算法、双线性内插值算法、双立方插值算法)
    C++ 类中成员函数的属性
  • 原文地址:https://www.cnblogs.com/hong2016/p/7237792.html
Copyright © 2020-2023  润新知