spring boot--6 web项目2CURD

1 ). RestfulCRUD : CRUD满足Rest风格;
URI: /资源名称/资源标识
HTTP请求方式区分对资源CRUD操作

spring boot--6 web项目2CURD

实验的请求架构;
spring boot--6 web项目2CURD

thymeleaf公共页面元素抽取
spring boot--6 web项目2CURD

第一种方式:

spring boot--6 web项目2CURD

spring boot--6 web项目2CURD

第二种方式:

spring boot--6 web项目2CURD

spring boot--6 web项目2CURD

三种引入功能片段的th属性:
th:insert :将公共片段整个插入到声明引入的元素中
th:replace :将声明引入的元素替换为公共片段
th:include :将被引入的片段的内容包含进这个标签中

spring boot--6 web项目2CURD
spring boot--6 web项目2CURD

当前模块高亮:

在引入时传入一个参数,如果是这个参数就,就添加高亮类

spring boot--6 web项目2CURD

spring boot--6 web项目2CURD

循环数据:

spring boot--6 web项目2CURD

添加员工:

spring boot--6 web项目2CURD

//员工添加.
//SpringMVC自动将请求参数和入参对象的属性进行一一绑定; 要求请求参数的名字和javaBean入参的对象里面的属性名相同

spring boot--6 web项目2CURD

spring boot--6 web项目2CURD

提交的数据格式不对:生日:日期;
2017-12-12 ; 2017/12/12; 2017.12.12 ;
日期的格式化; SpringMVC将页面提交的值需要转换为指定的类型;
2017-12-12--Date;类型转换.格式化;
默认日期是按照/
配置文件中修改:spring boot--6 web项目2CURD

修改:

spring boot--6 web项目2CURD

spring boot--6 web项目2CURD

回显:

spring boot--6 web项目2CURD

spring boot--6 web项目2CURD

spring boot--6 web项目2CURDspring boot--6 web项目2CURD

修改完之后会导致添加页面失灵,会把添加操作当做修改操作,解决:判断是否有对象传入

spring boot--6 web项目2CURD

spring boot--6 web项目2CURD

spring boot--6 web项目2CURD

注意:同时要传进原先的id值

删除:

spring boot--6 web项目2CURD

spring boot--6 web项目2CURD