Spring Boot项目结构

下面是Spring Boot Web项目的一般结构

+- src/
|   +- main/
|        +- java/
|        |   +- com
|        |       +- controller/
|        |       |   +- IndexController.class
|        |       +- Application.class
|        +- resources/
|            +- config/
|            |   +- application.properties
|            +- public/
|            |   +- error/
|            |   |   +- 404.html
|            |   +- favicon.ico
|            |   +- index.html
|            +- templates/
|                +- index.ftlh
+- test/
+- pom.xml
  • Application.class 是Spring Boot应用程序启动类,也可以作为配置类。
  • application.properties是配置文件,Spring Boot的大部分配置都是通过属性配置的。
  • public 目录为静态资源目录,error内为静态错误页面
  • favicon.ico是应用程序的图标,和传统的web应用程序一样
  • templates内的文件为模板引擎文件,上面的index.ftlh为freemarker模板文件。
  • test 测试代码存放位置,和main目录大致类似,省略。
posted @ 2020-01-03 14:36  StrongerBrother  阅读(665)  评论(0编辑  收藏  举报