springboot框架中集成thymeleaf引擎,使用form表单提交数据,debug结果后台获取不到数据

表单html:

                            <form class="form-horizontal form-material" th:object="${user}" th:action="@{/user/updateOneUserInfo}" method="post">
<input type="hidden" name="id" th:field="*{id}">
<div class="form-group">
<label class="col-md-12">姓 名</label>
<div class="col-md-12">
<input type="text" placeholder="Johnathan Doe" class="form-control form-control-line" th:field="*{userName}">
</div>
</div>
<div class="form-group">
<label for="example-email" class="col-md-12">邮 箱</label>
<div class="col-md-12">
<input type="email" placeholder="johnathan@admin.com" th:field="*{email}" class="form-control form-control-line" name="example-email" id="example-email">
</div>
</div>
<div class="form-group">
<label class="col-md-12">电话号码</label>
<div class="col-md-12">
<input type="text" placeholder="123 456 7890" th:field="*{telephone}" class="form-control form-control-line">
</div>
</div>
<div class="form-group">
<label class="col-md-12">职 业</label>
<div class="col-md-12">
<input type="text" placeholder="" th:field="*{job}" class="form-control form-control-line">
</div>
</div>
<div class="form-group">
<label class="col-md-12">个人简介</label>
<div class="col-md-12">
<textarea rows="5" class="form-control form-control-line" th:field="*{shortMessage}"></textarea>
</div>
</div>
<!--地址暂未处理-->
<div class="form-group">
<label class="col-sm-12">选择所在地</label>
<div class="col-sm-12">
<div data-toggle="distpicker" class="row col-md-12">
<select class="col-md-4 form-control" data-province="北京市"></select>
<select class="col-md-4 form-control" data-city="北京城区"></select>
<select class="col-md-4 form-control" data-district="东城区"></select>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-12" style="text-align: center">
<button class="btn btn-success" type="submit">更新资料</button>
</div>
</div>
</form>

后台按照post的地址进行接收即可,需要注意的是,提交数据的时候,button或者input都设置成为submit,然后获取数据的时候用成th:field={*变量}的形式获取数据即可

springboot框架中集成thymeleaf引擎,使用form表单提交数据,debug结果后台获取不到数据的更多相关文章

  1. SpringMVC中使用bean来接收form表单提交的参数时的注意点

    这是前辈们对于SpringMVC接收表单数据记录下来的总结经验: SpringMVC接收页面表单参数 springmvc请求参数获取的几种方法 下面是我自己在使用时发现的,前辈们没有记录的细节和注意点 ...

  2. Jobs(三) HTML的form表单提交中文后,后台取出乱码的问题

    解决form表单中提取的中文在后台乱码的问题有两种情况: form表单以GET方式提交: form表单以POST方式提交 一. 解决以GET方式提交的中文乱码问题,可以更改Tomcat服务器的配置文件 ...

  3. Django框架之第二篇--app注册、静态文件配置、form表单提交、pycharm连接数据库、django使用mysql数据库、表字段的增删改查、表数据的增删改查

    本节知识点大致为:静态文件配置.form表单提交数据后端如何获取.request方法.pycharm连接数据库,django使用mysql数据库.表字段的增删改查.表数据的增删改查 一.创建app,创 ...

  4. 小程序 <web-view></web-view> 中使用 form 表单提交

    在最近的小程序项目中,使用到了 <web-view></web-view> 内嵌 H5 页面,在 H5 中需要使用 form 表单提交数据. H5 使用的技术框架是 vue+v ...

  5. ajax form表单提交 input file中的文件

    ajax form表单提交 input file中的文件 现今的主流浏览器由于ajax提交form表单无法把文件类型数据提交到后台,供后台处理,可是开发中由于某些原因又不得不用ajax提交文件, 为了 ...

  6. php form表单提交时,action url中参数无效的解决方法

    表单提交时get方式的一个错误 <form class="form-inline pull-right" method="get" action=&quo ...

  7. Flask基础之返回值与form表单提交

    目录 1.Python 现阶段三大主流Web框架 Django Tornado Flask 对比 2.Flask的安装 3.Flask的第一个简单应用 4.Flask中的render_template ...

  8. Form表单提交,Ajax请求,$http请求的区别

    做过前端同学想必都避免不了要和后台server打交道.而以下这三种与后台交互的方式想必大家都不陌生. Form表单提交,Ajax请求,Angular的$http请求 以前一直搞不清楚什么时候应该用哪种 ...

  9. thinkPHP5.0使用form表单提交数据和删除文章,不用TP的提示页面,使用弹出提示信息

    form表单提交数据和删除文章时,TP的默认信息提示页面的看起来不是很好看,想要实现弹窗提示怎么做呢? 前端:可以使用前端的一个知识--iframe,iframe元素会创建包含另外一个文档的内联框架: ...

随机推荐

  1. linux中常见压缩文件格式

    文件后缀名 说明 *.zip zip 程序打包压缩的文件 *.rar rar 程序压缩的文件 *.7z 7zip 程序压缩的文件 *.tar tar 程序打包,未压缩的文件 *.gz gzip 程序( ...

  2. windows 安装MySQL服务 zip解压程序

    1:配置 my.ini 文件 如下: [mysql] default-character-set=utf8[mysqld] port=3306basedir=D:\\Program Files\\da ...

  3. Opencv笔记(十)——卷积基础

    卷积 什么是二维卷积呢?看下面一张图就一目了然:         卷积就是循环对图像跟一个核逐个元素相乘再求和得到另外一副图像的操作,比如结果图中第一个元素5是怎么算的呢?原图中3×3的区域与3×3的 ...

  4. iOS之NSString类型为什么要用copy修饰

    在开发的过程中,只知道NSString类型最好用copy修饰而不能用strong,但是不知道为什么,今天了解了下,总算搞明白了. 如下所示,当修饰符为copy时,因为NSMutableString是N ...

  5. 新年在家学java之基础篇-参数&修饰符&构造器

    可变参数 不知道可能给方法传递多少个参数时使用这个方法 public void printInfo (String[] args) --可以定义一个数组,在调用这个方法适合赋值给一个数组 public ...

  6. redis数据库写入数据时提示redis.exceptions.ResponseError错误

    今天运行Django项目在redis数据库写入数据时提示如下错误: ERROR log 228 Internal Server Error: /image_code/cf9ccd75-d274-45c ...

  7. 记录ionic 最小化应用时所遇的问题

    ionic3与ionic4最小化插件安装不一样: ionic3安装方法: $ ionic cordova plugin add cordova-plugin-appminimize $ npm ins ...

  8. 扩增|feather evolution

    Wool vs feather 扩增方法:1.Gene Duplication2.Genome Duplication3.Cluster 哺乳动物毛发和鸟类的羽毛,都来自于角蛋白. 羽毛进化图 DNA ...

  9. LIS 问题

    #include<cstdio> #include<iostream> #include<algorithm> #include<queue> #inc ...

  10. Ajax - XMLHTTP实例

    url:http://localhost/index.htm <html> <head> <title>Ajax</title> <script ...