Spring Boot实战系列《六》:人事管理系统的登录设计
1.前言
在上一篇中教大家在IEDA或者eclipse中使用spirng initializer快速创建spring boot项目,这样构造出来的spring boot项目,自动配置了基本的运行环境和项目结构。便于开发时的继续工作,推荐使用。
那么在经过了前面几篇的介绍以后,接下里我们开始做一个小小的人事管理系统,来进一步熟悉spring boot的开发流程。
本次人事管理系统的基本技术有:
- bootstrap
- spring boot
- mysql
- mybatis
- spring mvc
- thymeleaf…
废话不多说,先使用spirng initializer来快速创建人事管理系统项目。
2.创建人事管理系统项目
首先新建spring boot项目,
填写项目的名称:
就叫pmsystem吧。
勾选需要的模块依赖:
然后选择项目保存的路径,点击完成。IDEA就会开始自动导入jar包,最后完成项目构建。
最后创建好了项目如下:
鉴于pom.xml爱出问题,我这里给出源码:
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.zout</groupId>
<artifactId>pmsystem</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>pmsystem</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<!-- 布局功能的支持程序 thymeleaf3主程序 layout2以上版本 -->
<!-- thymeleaf2 layout1-->
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
</properties>
<dependencies>
<!-- 引入thymeleaf模板引擎 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- 引入web模块 -->
<dependency>
<groupId>org.springframe