Workbook 1.2
You will create a simple web application using Spring Boot.
Spring Initializr
Launch the Spring Initializr from Visual Studio Code.
Group Id
Group Id identifies the organization
It cannot contain capital letters and must be a fully-qualified domain.
Artifact Id
Artifact Id determines the application name.
It cannot contain capital letters and must join words with a hyphen.
Java version
Be careful when selecting the Java version.
Your project will not compile if selects a higher version than the one you installed.
Example
-
Java 17 is installed.
-
The project selects a version of 19.
Trying to compile throws an error: invalid target release: 19
Dependencies
software that your application depends on.
Add the Spring Web dependency to bootstrap the launch of an HTTP server.
application.properties
configures the settings of your application.
Your application must respond to requests made on port 9090.
static folder
contains static HTML, images or CSS files.
Add an HTML file to the static
folder.
Your HTML must render a static view that contains four headers:
>> Printing is fun!
>> Java > Python.
>> I spilled Java all over my paper.
>> My dog ate my Java.
See the HTML Cheat Sheet if you need help setting up the HTML document.
Potential Error
If your application fails to start, terminate other applications running on port 9090.