In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
In view of how SpringBoot depends on the environment, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
one。 Prepare 1. Intellij IDEA2 before development. Jdk3. Maven II. Create the first springboot project 1. Create a project using Intellij IDEA
two。 Delete the following files
3. Change application.properties to application.yml (the attribute structure of yml file is more intuitive) server: port: 8888 # run port 4. Spring-boot-starter-web is introduced to depend on org.springframework.boot spring-boot-starter-web5. A hello world test Controller@RestControllerpublic class HelloController {@ RequestMapping ("/ hello") public String hello (String name) {return "hello world," + name;} 6. Test it
7. Project structure description
Directory location function src/main/java project java file storage location, initialization includes the main program entry XxxApplication, you can run this class directly to start the Spring Boot application src/main/resources to store static resources Src/main/resources/static such as pictures, CSS, JavaScript, web page template files are mainly used to store css, pictures, js and other development static files src/main/resources/public is used to store html files that can be directly used for access. Src/main/resources/templates is used to store web development template files src/test unit test code directory. Gitignoregit version management exclusion file target folder project code construction package result file location There is no need to maintain the pom.xmlmaven project configuration file application.properties (application.yml) for storing the configuration information of various dependent modules of the program, such as service port, database connection configuration and other questions about how SpringBoot depends on the environment. I hope the above content can be of some help to everyone, if you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.