This guide walks you through the process of creating a “Hello, World” web site with Spring.
What You Will Build
You will build an application that has a static home page and that will also accept HTTP GET requests at:
It will respond with a web page that displays HTML. The body of the HTML will contain a greeting: “Hello, World!”
You can customize the greeting with an optional
name parameter in the query string. The URL might then be
name parameter value overrides the default value of
World and is reflected in the response by the content changing to “Hello, User!”
What You Need
How to complete this guide
Like most Spring Getting Started guides, you can start from scratch and complete each step or you can bypass basic setup steps that are already familiar to you. Either way, you end up with working code.
To start from scratch, move on to Starting with Spring Initializr.
To skip the basics, do the following:
- Download and unzip the source repository for this guide, or clone it using Git:
git clone https://github.com/spring-guides/gs-serving-web-content.git
- cd into
- Jump ahead to Create a Web Controller.
When you finish, you can check your results against the code in