上篇介绍了项目的开发环境的搭建,这篇开始记录我的springboot项目开发全过程。
应用到的主要的组件与框架:
1.框架:springboot2.0.1
2.数据库:mysql5.7
3.持久化:hibernate5
4.模板框架:freemarker
5.页面装饰器:sitemesh3
6.缓存:ehcache
7.日志:logback
8.服务器容器:tomcat8
一、构建项目
1.pom,里面好多前期不需要,但是后期都会用到的慢慢来
<?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.example</groupId>
<artifactId>springboot-e</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<name>springboot-e</name>
<description>springboot-e project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath />
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependen