Spring Boot highlights-startup and hot deployment, springboot
Spring boot requires a startup class such
Package com. tianmaying; import org. springframework. boot. springApplication; import org. springframework. boot. autoconfigure. springBootApplication; import org. springframework. boot. web. servlet. servletComponentScan; @ SpringBootApplication @ ServletComponentScanpublic class BlogApplication {public static void main (String [] args) throws Exception {SpringApplication. run (BlogApplication. class, args );}}
The path of the Servlet class must beBlogApplicationThe sub-path of the package path can be scanned. Otherwise, the sub-path must passBasePackagesAttribute specifies the package of the Servlet class.
2. Let the Spring Boot project support hot deployment and add the following dependencies to the maven configuration file:
<Dependencies> <dependency> <groupId> org. springframework. boot </groupId> <artifactId> spring-boot-devtools </artifactId> </dependency> </dependencies>