Spring Boot v.2.0.2 Release Hello World Example
Spring Boot v.2.0.2 Hello World Example.
This is our first simple Spring Boot Hello World example. I am using these following ingredients to build and run this simple Spring Boot Web Application.
- Intellij Idea 14.1.7
- jdk 1.8.0_162
- Gradle 4.6
![]() |
| Create New Project |
We create our Project by using Spring Initializr. At this point you can configure Project SDK, here we use 1.8 as shown below.
![]() |
| Create New Project using Spring Inializr |
After clicked on next button, Now setting the Project's basic configuration as show below.
![]() |
| Project Basic Settings |
Now at next screen first select Spring Boot Version (we are using 2.0.2) and also select Spring boot Starter Web Freamwork and Thymeleafe as Templating Engine.
![]() |
| Spring Boot Setting |
![]() |
| Setting Spring Boot Project Name and Location |
After finish the wizard, you need to import your Spring Boot Project as Gradle Project. The ballon or tool tip will appear in Intellij as show below.
![]() |
| Import Your Spring Boot Project as Gradle Project |
![]() |
| Gradle Import Settings |
After download all the project dependencies, here we have our Spring Boot Project Structure. Now Intellij does not recognize source, resources and test directories so you can mark it manually.
![]() |
| Mark Source, Resources and Test Directories |
Now the last step is include a view in our Spring Boot Project. Create a HTLM page in src/main/resources/templates/index.html
![]() |
| Create a View (html page) in our project |
Now at this stage our First Simple Spring Boot Project is ready to run. Spring Boot have Emebedded Tomcat Server so we don't need to configure any External Server or Servlet Engine.
Now just double click on gradle's bootRun task and the Spring Boot Majic begins.
![]() |
| BootRun |
![]() |
| Spring Boot Web App Starts on port 8080. |
Now we can access our Spring Boot Web Application on http://localhost:8080/
![]() |
| Accessing Spring Boot Web App at http://localhost:8080/ |












Comments
Post a Comment