Spring Tool 4通过Spring Initializr快速搭建SpringBoot应用
2018-12-26 16:44
375 查看
1、创建一个Spring Initializr项目(右键->Spring Starter Project)
2、在application.properties应用属性配置文件中可直接修改端口号(因为tomcat是内嵌在SpringBoot之中的)
3、在SpringBoot应用类的包下面创建Controller应用(注意一定要在应用类对应包下,否则扫描器无法扫描到你的类)
4、启动并通过路径访问资源
5、总结
本人一开始进行学习时,用idea如鱼得水,后来用Spring tools运行SpringBoot时,发现怎么都不能扫描到Bean,一开始以为是工具的问题,直到我的idea遇到同样的问题。我们一定要把MVC三层架构的包创建在SpringBoot应用类对应的包下面,否则,我们的类无法被扫描器扫描到。希望大家引以为戒。如有不足之处,欢迎大家在下方留言。
相关文章推荐
- 【SpringBoot】2.快速搭建一个SpringBoot应用
- 通过Spring Boot + Mybatis + Redis快速搭建现代化Web项目
- spring-boot快速搭建web应用教程一-基础环境搭建
- SPRING BOOT快速搭建WEB应用教程(二)—HELLOWORLD
- 用Spring Boot & Cloud,Angular2快速搭建微服务web应用 - AngularJS2客户端
- 用Spring Boot & Cloud,Angular2快速搭建微服务web应用 - 实现RESTful CRUD
- 聊聊SpringBoot | 第一章:快速搭建SpringBoot第一个应用
- springboot入门(一)--快速搭建一个springboot框架
- spring boot / cloud (十七) 快速搭建注册中心和配置中心
- IntelliJ IDEA搭建SpringBoot应用
- 使用Spring Boot快速构建应用
- 使用 Spring Boot 快速构建 Spring 框架应用--转
- springboot快速实战搭建篇
- 一步步学习SpringBoot(一) 快速搭建一个web
- 使用Spring Boot快速构建应用
- Spring Boot+JPA+Mysql+ThymeLeaf快速构建CURD系统(二)搭建SpringBoot工程
- Spring Boot+JPA+Mysql+ThymeLeaf快速构建CURD系统(二)搭建SpringBoot工程
- spring boot / cloud (十八) 使用docker快速搭建本地环境
- 使用 Spring Boot 快速构建 Spring 框架应用
- 使用Spring boot基于Redis快速搭建分布式Session缓存方案