zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Linux命令笔记
    Linux服务安装集合(1)
    浅谈GIT之通讯协议
    浅谈GIT之底层对象理解
    友情链接
    当黑客被抓是种怎样的体验?
    PHP 中 include 和 require 的区别详解
    论假如有一台无限算力的主机
    msf渗透安卓手机
    aws ec2 安装Elastic search 7.2.0 kibana 并配置 hanlp 分词插件
  • 原文地址:https://www.cnblogs.com/hong2016/p/7237792.html
Copyright © 2011-2022 走看看