2017年11月7日
摘要: 在开发阶段我们推荐使用内嵌的tomcat进行开发,因为这样会方便很多,但是到生成环境,我希望在独立的tomcat容器中运行,因为我们需要对tomcat做额外的优化,这时我们需要将工程打包成war包发进行发布。 1.1. 工程的打包方式为war 1.2. 将spring-boot-starter-to 阅读全文
posted @ 2017-11-07 16:19 人生若只如初见yao 阅读(10461) 评论(0) 推荐(1)
摘要: Web开发的自动配置类:org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration 1.1. 自动配置的ViewResolver 视图的配置mvcProperties对象中: org.springframework.boot. 阅读全文
posted @ 2017-11-07 16:15 人生若只如初见yao 阅读(362) 评论(0) 推荐(0)
摘要: Spring Boot在进行SpringApplication对象实例化时会加载META-INF/spring.factories文件,将该配置文件中的配置载入到Spring容器。 1.1.1. Maven下载源码 通过 dependency:sources 该命令可以下载该项目中所有的依赖的包的源 阅读全文
posted @ 2017-11-07 15:58 人生若只如初见yao 阅读(639) 评论(0) 推荐(0)
摘要: 1.1.1. 入口类和@SpringBootApplication Spring Boot的项目一般都会有*Application的入口类,入口类中会有main方法,这是一个标准的Java应用程序的入口方法。 @SpringBootApplication注解是Spring Boot的核心注解,它其实 阅读全文
posted @ 2017-11-07 15:53 人生若只如初见yao 阅读(772) 评论(0) 推荐(0)
摘要: # # COMMON SPRING BOOT PROPERTIES # # This sample file is provided as a guideline. Do NOT copy it in its # entirety to your own application. ^^^ # # # 阅读全文
posted @ 2017-11-07 15:48 人生若只如初见yao 阅读(11516) 评论(0) 推荐(0)
摘要: 1.1.1. 设置spring boot的parent 说明:Spring boot的项目必须要将parent设置为spring boot的parent,该parent包含了大量默认的配置,大大简化了我们的开发。 1.1.2. 导入spring boot的web支持 1.1.3. 添加Spring 阅读全文
posted @ 2017-11-07 15:23 人生若只如初见yao 阅读(1598) 评论(0) 推荐(0)