Steps to get started with Spring Boot Web Application
- Go to Help > Eclipse Marketplace… and search type “spring sts” in Find text field under Search tab. Install the entry with the title such as “Spring Tool Suite (STS) for Eclipse
Release”. Once installed, you would be asked to restart the Eclipse. Go ahead and restart the eclipse.
- Open the new Project selector window using shortcut, CTRL + N. Type “Spring Starter” and double-click the entry namely, “Spring Starter Project”. It would take you to next window such as following. Just click “Next” and move to next step.
- On next window, select the dependencies as “Web” as shown in the diagram below.
Click Finish. This would create the project whose source code and config files/libraries structure would look following. Note the DemoApplication.java file which gets created by default.
- Right-click on the project as shown below and start the Spring Boot app.
Once the web app starts, access the web app in browser using URL such as http://localhost:8080/
- Tweak the DemoApplication code a little to start working with the Web App.
package com.example; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller @SpringBootApplication public class DemoApplication { @RequestMapping("/") @ResponseBody String home() { return "Hello World. How are you?"; } public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
The same code could be found on the Spring Boot homepage. Relaunch the web app and see the changes like following by access the http://localhost:8080 in the browser.
- LLMs for Adaptive Learning & Personalized Education - October 8, 2024
- Sparse Mixture of Experts (MoE) Models: Examples - October 6, 2024
- Anxiety Disorder Detection & Machine Learning Techniques - October 4, 2024
Thank you! Very simple)