没有合适的资源?快使用搜索试试~ 我知道了~
Springboot SpringMVC thymeleaf页面提交Validation实现实例.pdf
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 106 浏览量
2022-06-23
02:08:49
上传
评论
收藏 507KB PDF 举报
温馨提示
试读
11页
Springboot SpringMVC thymeleaf页面提交Validation实现实例.pdfSpringboot SpringMVC thymeleaf页面提交Validation实现实例.pdfSpringboot SpringMVC thymeleaf页面提交Validation实现实例.pdfSpringboot SpringMVC thymeleaf页面提交Validation实现实例.pdfSpringboot SpringMVC thymeleaf页面提交Validation实现实例.pdfSpringboot SpringMVC thymeleaf页面提交Validation实现实例.pdfSpringboot SpringMVC thymeleaf页面提交Validation实现实例.pdfSpringboot SpringMVC thymeleaf页面提交Validation实现实例.pdf
资源推荐
资源详情
资源评论
Springboot+SpringMVC+thymeleaf 页面提交 Validation 实现
实例
本例所使用的框架:
1. Spring boot
2. Spring MVC
3. thymeleaf
说明:
1. 本文针对采用 Spring boot 微框架之用户,完全采用 Java config,不讨论 xml
配置。
一、
本页面姓名输入不能为空:
页面提交验证效果
清空姓名输入框后点提交,则姓名输入框变为红色,并在下面提示 名称不能为
空
1
二、
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Getting Started: Serving Web Content</title>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="all"
th:href="@{/css/user.css}" />
</head>
<body>
<form action="#" th:action="@{/user}"
页面代码
th:object="${user}" enctype="multipart/form-data"
method="post">
<table >
<tr>
<td ><div><input type="text" name="fname"
th:field="*{fname}"
th:class="${#fields.hasErrors('fname')}? fieldError"/>
<p th:if="${#fields.hasErrors('fname')}"
th:errors="*{fname}">Incorrect data</p>
2
</div></td>
</tr>
<tr>
<td ><label for="password">姓名</label><input
type="text" name="password" th:field="*{password}"/></td>
</tr>
<tr>
<td ><input type="text" name="email"
th:field="*{email}"/></td>
</tr>
</table>
<input type="file" name="shangchuan" />
<p th:text="#{addrow}">addrow</p>
<input type="submit" name="save" value="
经提交
"
th:value="#{submit}" />
<input type="submit" name="addrow" value="
上传
"
th:value="#{addrow}" />
</form>
</body>
</html>
上文中,<input type="text" name="fname" th:field="*{fname}"
th:class="${#fields.hasErrors('fname')}? fieldError"/>
3
剩余10页未读,继续阅读
资源评论
春哥111
- 粉丝: 1w+
- 资源: 5万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于STM32F103C8T6单片机蓄电池在线监测系统主板硬件(原理图+PCB)工程文件.zip
- mysql大纲资料.txt
- c++大纲资料.txt
- 效率工具bat脚本实现日志提取
- MyBatis 中动态 SQL 的示例
- STM8L101F3P6单片机+CC1100模块433M遥控器设计硬件(原理图+PCB)工程文件.zip
- 上传下载铁人下载系统 Liuxing 1.0-liuxing1.0.rar
- 南京邮电大学数学实验实力雄厚,凭借其优秀的师资力量、丰富的实践教学资源和卓越的科研成果,成为国内一流的数学实验教学和科研基地
- 【火爆朋友圈的今天吃什么源码 v1.0】随机的为用户带来每一天的用餐选择和推荐.rar
- MPU6050中文版数据手册
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功