form表单传递实体类对象,后台接收

9 篇文章 0 订阅
8 篇文章 1 订阅

1.新建实体类

public class Student {
    String Idnumber;
    String Studentnumber;
    String username;
    String password;
    String name;
    String introduction;
    String place;
    String phonenumber;
    String email;
    String universitylevel;
    String universityname;
    String schoolhours;
    String universityintroduction;
    int html;
    int css;
    int js;
    int php;
    int java;
    int c;
    int photoshop;
    String companyname;
    String post;
    String workhours;
    String companyintroduction;
    

2.form表单

<form id="tang" action="studentinformation11" method="post">
IDnumber<input th:id="idnumber" id="Idnumber" name="Idnumber" th:value="${idnumber}">
姓名<input type="text" id="name" name="name"><br>
个人简介<input type="text" id="introduction" name="introduction"><br>
地址<input type="text" id="place" name="place"><br>
电话号码<input type="text" id="phonenumber" name="phonenumber"><br>
email<input type="text" id="email" name="email"><br>
大学等级<input type="text" id="universitylevel" name="universitylevel"><br>
大学名称<input type="text" id="universityname" name="universityname"><br>
在校时间<input type="text" id="schoolhours" name="schoolhours"><br>
<!--毕业时间<input type="text" id="graduation">-->
简介<input type="text" id="universityintroduction" name="universityintroduction"><br>
html<input type="text" id="html" name="html"><br>
css<input type="text" id="css" name="css"><br>
js<input type="text" id="js" name="js"><br>
php<input type="text" id="php" name="php"><br>
java<input type="text" id="java" name="java"><br>
c<input type="text" id="c" name="c"><br>
photoshop<input type="text" id="photoshop" name="photoshop"><br>
公司名称<input type="text" id="companyname" name="companyname"><br>
职务<input type="text" id="post" name="post"><br>
在职时间<input type="text" id="workhours" name="workhours"><br>
公司简介<input type="text" id="companyintroduction" name="companyintroduction"><br>
<input type="submit"  value="提交">
</form>

后台:

    @RequestMapping(value = "/studentinformation11",method = RequestMethod.POST)
    public String studentinformation11(Student student){
        System.out.println(student);
//        studentMapper.updatestudent(student);
        return "success";
    }

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值