SpringBoot Getting Started Example
Goal: Build a web application using SpringBoot where a browser request to /hello returns the string “Hello Spring”.
First, create a SpringBoot project and select the web development dependencies.
Next, create a controller class. Create Controller/HelloController.java in the same directory as your *Application.java file.
| |
Run the *Application.java class and visit
http://localhost:8080/hello
in your browser.
HTTP
HTTP (Hypertext Transfer Protocol) is based on TCP (connection-oriented, secure) and follows a request-response model (one request corresponds to one response).
HTTP is a stateless protocol, meaning it has no memory of past transactions. Each request-response pair is independent. This makes it fast, but it also means data cannot be shared between multiple requests by default.
For more details, see: https://blog.yexca.net/archives/64