欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

SpringMVC form标签引入及使用方法

程序员文章站 2023-10-28 08:45:58
1.需在jsp页面引入头文件:<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>2.在js...

1.需在jsp页面引入头文件:

<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

2.在jsp页面的使用方法:

SpringMVC form标签引入及使用方法

3.对应controller的使用:

@requestmapping(value = "/to_check",params = "id")
  public string tocheck(int id, map<string, object> map){
    map.put("claimvoucher",claimvoucherbiz.get(id));
    map.put("items",claimvoucherbiz.getitems(id));
    map.put("records",claimvoucherbiz.getrecords(id));
    dealrecord dealrecord =new dealrecord();
    dealrecord.setclaimvoucherid(id);
    map.put("record",dealrecord);    //通过map返回modelattribute对应的实体对象
    return "claim_voucher_check";
  }

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。