update 'Spring Boot' course

This commit is contained in:
2026-02-19 15:59:51 +03:00
parent fb719c36fe
commit 4806e46b93
21 changed files with 904 additions and 6 deletions

View File

@@ -34,3 +34,384 @@ weight: 3
While the spring framework is powerfull, using it often involves a lot of configuration. For example, if you want to build a web app you might need to setup a web server, configure routing and manage dependencies manually. That's when **Spring Boot** comes in. While the spring framework is powerfull, using it often involves a lot of configuration. For example, if you want to build a web app you might need to setup a web server, configure routing and manage dependencies manually. That's when **Spring Boot** comes in.
You can think of spring boot as a layer on top of the spring framework, that takes care of all of the setup. You can think of spring boot as a layer on top of the spring framework, that takes care of all of the setup.
*Sring Boot* siplifies Spring development by providing sensible defaults and ready-to-use features.
By the way, the spring framework is just one part of a larger family of projects in the spring ecosystem.
![Spring ecosystem](assets/spring-ecosystem.svg)
*Img. 2 -- Spring ecosystem*
| **Module Name** | **Purpose** |
| ------------- | -------------- |
| *Spring Data* | Simplifying database access |
| *Spring Security* | Adding authentication and authorization |
| *Spring Batch* | Batch processing |
| *Spring Cloud* | Building microservices and distributed systems |
| *Spring Integration* | Symplifying messaging and integration between systems |
---
# Initialize Spring Boot Project
To initialize a new spring boot project you can go to [start.spring.io](https://start.spring.io/) and select options that suits you.
![Spring Options](assets/spring-project-init.png)
*Img. 3 -- Spring Boot options*
After unpacking the `zip` arvhive we have this template project.
```bash
.
├── HELP.md
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src
│ ├── main
│ │ ├── java
│ │ │ └── us
│ │ │ └── fymio
│ │ │ └── store
│ │ │ └── StoreApplication.java
│ │ └── resources
│ │ └── application.properties
│ └── test
│ └── java
│ └── us
│ └── fymio
│ └── store
│ └── StoreApplicationTests.java
└── target
├── classes
│ ├── application.properties
│ └── us
│ └── fymio
│ └── store
│ └── StoreApplication.class
├── generated-sources
│ └── annotations
├── generated-test-sources
│ └── test-annotations
├── maven-status
│ └── maven-compiler-plugin
│ ├── compile
│ │ └── default-compile
│ │ ├── createdFiles.lst
│ │ └── inputFiles.lst
│ └── testCompile
│ └── default-testCompile
│ ├── createdFiles.lst
│ └── inputFiles.lst
├── surefire-reports
│ ├── TEST-us.fymio.store.StoreApplicationTests.xml
│ └── us.fymio.store.StoreApplicationTests.txt
└── test-classes
└── us
└── fymio
└── store
└── StoreApplicationTests.class
```
The "heart" of our project is the file named `pom.xml`:
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.0.2</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>us.fymio</groupId>
<artifactId>store</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>store</name>
<description>Store</description>
<url />
<licenses>
<license />
</licenses>
<developers>
<developer />
</developers>
<scm>
<connection />
<developerConnection />
<tag />
<url />
</scm>
<properties>
<java.version>21</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
```
Maven uses this file to download dependencies and build our project.
In the `source` folder we have the actual code for our project.
```bash
src
├── main
│ ├── java
│ │ └── us
│ │ └── fymio
│ │ └── store
│ │ └── StoreApplication.java
│ └── resources
│ └── application.properties
└── test
└── java
└── us
└── fymio
└── store
└── StoreApplicationTests.java
```
The `StoreApplication.java` file is the entry point to our application.
```java
package us.fymio.store;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class StoreApplication {
public static void main(String[] args) {
SpringApplication.run(StoreApplication.class, args);
}
}
```
In the `main` method we have a call to `SpringApplication.run` method.
If we run `mvn clean install` from the root of our project we will get this result (the output is partially reduced):
```bash
...
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.542 s -- in us.fymio.store.StoreApplicationTests
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- jar:3.4.2:jar (default-jar) @ store ---
[INFO] Building jar: /home/fymio/store/target/store-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot:4.0.2:repackage (repackage) @ store ---
...
...
[INFO] Installing /home/fymio/store/pom.xml to /home/fymio/.m2/repository/us/fymio/store/0.0.1-SNAPSHOT/store-0.0.1-SNAPSHOT.pom
[INFO] Installing /home/fymio/store/target/store-0.0.1-SNAPSHOT.jar to /home/fymio/.m2/repository/us/fymio/store/0.0.1-SNAPSHOT/store-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.787 s
[INFO] Finished at: 2026-02-19T13:16:47+03:00
[INFO] ------------------------------------------------------------------------
```
So we can tell that our application was built without errors.
# Dependency Management
Dependencies are third-party libraries or frameworks we use in our application. For example to build a web application we need an embedded web server like *Tomcat*, we need libraries for handling web requests building APIs, processing JSON data, logging and so on.
In spring boot applications instead of adding multiple individual libraries we can use a **starter dependency**.
![Spring Boot Starter Web](assets/spring-boot-starter-web.svg)
*Img. 5 -- Spring Boot Starter Web*
To use this dependency we just need to copy the code below to our `pom.xml` file.
```xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>4.1.0-M1</version>
</dependency>
```
So the `dependencies` section would look like this
```xml
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- <version>4.1.0-M1</version> -->
</dependency>
</dependencies>
```
Notice, that I commented out the version of our dependency. That's because it's a better practice to let Spring Boot decide what version of the dependency to use.
# Controllers
**Spring MVC** stands for *Model View Controller*.
*Model* is where our application's data lives. It represents the business logic and is usually connected to a database or other data sources. In spring boot the model can be a simple java class.
*View* is what the user sees. It's the HTML, CSS or JavaScript that's rendered in the browser. In Spring MVC views can be static files or dynamically generated.
*Controller* is like a traffic controller. It handles incoming requests from the user, interacts with the model to get data and then tells the view what to display.
Let's add a new java class called `HomeController`. It will be located at `src/main/java/us/fymio/store/HomeController.java`.
```java
package us.fymio.store;
public class HomeController {}
```
To make this a controller we have to decorate it with the controller annotation. And import the `Controller` from `org.springframework.stereotype` package.
```java
package us.fymio.store;
import org.springframework.stereotype.Controller;
@Controller
public class HomeController {}
```
Let's now add an `index` method. When we send a request to the root of our website we want this method to be called. Also we need to add another special annotation to this method.
```java
package us.fymio.store;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HomeController {
@RequestMapping("/") // this represents the root of our website
public String index() {
return "index.html"; // this returns the view
}
}
```
Now we need to create this view. We add the `index.html` at `src/main/resources/static/index.html`. For now let's just print "Hello world!".
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>View</title>
</head>
<body>
<h1>Hello world!</h1>
</body>
</html>
```
Now let's build our application using `mvn spring-boot:run`.
As we can see from the logs:
```bash
2026-02-19T14:55:23.948+03:00 INFO 36752 --- [store] [ main] o.s.boot.tomcat.TomcatWebServer : Tomcat initialized with port 8080 (http)
```
It means that our app is up and running at [localhost:8080](http://localhost:8080/).
![Hello world!](assets/hello-world.png)
*Img. 7 -- Our app is up and running!*
# Configuring Application Properties
Let's take a look at our `application.properties` file located at `src/main/resources/application.properties`.
```properties
spring.application.name=store
```
To use this property in our code we can use the `@Value` annotation.
Let's change our `HomeController` class so it prints the name of our application.
```java
package us.fymio.store;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HomeController {
@Value("${spring.application.name}")
private String appName;
@RequestMapping("/") // this represents the root of our website
public String index() {
System.out.println("application name = " + appName);
return "index.html"; // this returns the view
}
}
```
And as we can see after running our application there is a `store` printed out in the terminal.
```bash
...
2026-02-19T15:32:37.507+03:00 INFO 41536 --- [store] [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2026-02-19T15:32:37.509+03:00 INFO 41536 --- [store] [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms
application name = store
...
```
# Dependency injection
Imagine we are building an E-Commerce application that handles placing orders. When the order is placed, the customer's payment needs to be processed so order service depends on a payment service like stripe payment service. In this case we can say that order service is *dependent* or *coupled to* stripe payment service.
![Depends on/Coupled to relation](assets/depends-on-coupled-to.svg)
*Img. 8 -- Depends On/Coupled To relation.*

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 54 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 103 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

0
layouts/list.rss.xml Normal file
View File

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 103 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 43 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 54 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 103 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

View File

@@ -33,7 +33,7 @@ Layer Purpose Core Handling dependency injection, managing objects Web Building
<meta itemprop="description" content="Prerequisites Solid understanding of Java Object-oriented programming Classes, methods and interfaces Basic understanding of databases Tables, primary keys, foreign keys, relationships, etc. Write basic SQL statements What is a Spring Framework?Spring is a popular framework for building Java applications. It has a lot of modules, each designed to handle a specific task. They are combined into few different layers. <meta itemprop="description" content="Prerequisites Solid understanding of Java Object-oriented programming Classes, methods and interfaces Basic understanding of databases Tables, primary keys, foreign keys, relationships, etc. Write basic SQL statements What is a Spring Framework?Spring is a popular framework for building Java applications. It has a lot of modules, each designed to handle a specific task. They are combined into few different layers.
Img. 1 Spring layers Img. 1 Spring layers
Layer Purpose Core Handling dependency injection, managing objects Web Building web applications Data Working with databases AOP Aspect oriented programming Test Testing spring components While the spring framework is powerfull, using it often involves a lot of configuration. For example, if you want to build a web app you might need to setup a web server, configure routing and manage dependencies manually. Thats when Spring Boot comes in."> Layer Purpose Core Handling dependency injection, managing objects Web Building web applications Data Working with databases AOP Aspect oriented programming Test Testing spring components While the spring framework is powerfull, using it often involves a lot of configuration. For example, if you want to build a web app you might need to setup a web server, configure routing and manage dependencies manually. Thats when Spring Boot comes in.">
<meta itemprop="wordCount" content="156"> <meta itemprop="wordCount" content="1348">
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
<meta name="twitter:title" content="CodeJava"> <meta name="twitter:title" content="CodeJava">
<meta name="twitter:description" content="Prerequisites Solid understanding of Java Object-oriented programming Classes, methods and interfaces Basic understanding of databases Tables, primary keys, foreign keys, relationships, etc. Write basic SQL statements What is a Spring Framework?Spring is a popular framework for building Java applications. It has a lot of modules, each designed to handle a specific task. They are combined into few different layers. <meta name="twitter:description" content="Prerequisites Solid understanding of Java Object-oriented programming Classes, methods and interfaces Basic understanding of databases Tables, primary keys, foreign keys, relationships, etc. Write basic SQL statements What is a Spring Framework?Spring is a popular framework for building Java applications. It has a lot of modules, each designed to handle a specific task. They are combined into few different layers.
@@ -330,7 +330,7 @@ Layer Purpose Core Handling dependency injection, managing objects Web Building
</div></div></div></aside> </div></div></div></aside>
<nav class="hextra-toc hx:order-last hx:hidden hx:w-64 hx:shrink-0 hx:xl:block hx:print:hidden hx:px-4" aria-label="table of contents"> <nav class="hextra-toc hx:order-last hx:hidden hx:w-64 hx:shrink-0 hx:xl:block hx:print:hidden hx:px-4" aria-label="table of contents">
<div class="hextra-scrollbar hx:sticky hx:top-16 hx:overflow-y-auto hx:pr-4 hx:pt-6 hx:text-sm [hyphens:auto] hx:max-h-[calc(100vh-var(--navbar-height)-env(safe-area-inset-bottom))] hx:ltr:-mr-4 hx:rtl:-ml-4"><p class="hx:mb-4 hx:font-semibold hx:tracking-tight">On this page</p><ul></ul><ul></ul> <div class="hextra-scrollbar hx:sticky hx:top-16 hx:overflow-y-auto hx:pr-4 hx:pt-6 hx:text-sm [hyphens:auto] hx:max-h-[calc(100vh-var(--navbar-height)-env(safe-area-inset-bottom))] hx:ltr:-mr-4 hx:rtl:-ml-4"><p class="hx:mb-4 hx:font-semibold hx:tracking-tight">On this page</p><ul></ul><ul></ul><ul></ul><ul></ul><ul></ul><ul></ul><ul></ul>
<div class="hx:mt-8 hx:border-t hx:bg-white hx:pt-8 hx:shadow-[0_-12px_16px_white] hx:dark:bg-dark hx:dark:shadow-[0_-12px_16px_#111] hx:sticky hx:bottom-0 hx:flex hx:flex-col hx:items-start hx:gap-2 hx:pb-8 hx:border-gray-200 hx:dark:border-neutral-800 hx:contrast-more:border-t hx:contrast-more:border-neutral-400 hx:contrast-more:shadow-none hx:contrast-more:dark:border-neutral-400"> <div class="hx:mt-8 hx:border-t hx:bg-white hx:pt-8 hx:shadow-[0_-12px_16px_white] hx:dark:bg-dark hx:dark:shadow-[0_-12px_16px_#111] hx:sticky hx:bottom-0 hx:flex hx:flex-col hx:items-start hx:gap-2 hx:pb-8 hx:border-gray-200 hx:dark:border-neutral-800 hx:contrast-more:border-t hx:contrast-more:border-neutral-400 hx:contrast-more:shadow-none hx:contrast-more:dark:border-neutral-400">
<button aria-hidden="true" id="backToTop" onClick="scrollUp();" class="hx:cursor-pointer hx:transition-all hx:duration-75 hx:opacity-0 hx:text-xs hx:font-medium hx:text-gray-500 hx:hover:text-gray-900 hx:dark:text-gray-400 hx:dark:hover:text-gray-100 hx:contrast-more:text-gray-800 hx:contrast-more:dark:text-gray-50"> <button aria-hidden="true" id="backToTop" onClick="scrollUp();" class="hx:cursor-pointer hx:transition-all hx:duration-75 hx:opacity-0 hx:text-xs hx:font-medium hx:text-gray-500 hx:hover:text-gray-900 hx:dark:text-gray-400 hx:dark:hover:text-gray-100 hx:contrast-more:text-gray-800 hx:contrast-more:dark:text-gray-50">
<span>Scroll to top</span> <span>Scroll to top</span>
@@ -393,6 +393,481 @@ Layer Purpose Core Handling dependency injection, managing objects Web Building
<hr> <hr>
<p>While the spring framework is powerfull, using it often involves a lot of configuration. For example, if you want to build a web app you might need to setup a web server, configure routing and manage dependencies manually. That&rsquo;s when <strong>Spring Boot</strong> comes in.</p> <p>While the spring framework is powerfull, using it often involves a lot of configuration. For example, if you want to build a web app you might need to setup a web server, configure routing and manage dependencies manually. That&rsquo;s when <strong>Spring Boot</strong> comes in.</p>
<p>You can think of spring boot as a layer on top of the spring framework, that takes care of all of the setup.</p> <p>You can think of spring boot as a layer on top of the spring framework, that takes care of all of the setup.</p>
<p><em>Sring Boot</em> siplifies Spring development by providing sensible defaults and ready-to-use features.</p>
<p>By the way, the spring framework is just one part of a larger family of projects in the spring ecosystem.</p>
<p><img src="assets/spring-ecosystem.svg" alt="Spring ecosystem" loading="lazy" />
<em>Img. 2 &ndash; Spring ecosystem</em></p>
<table>
<thead>
<tr>
<th><strong>Module Name</strong></th>
<th><strong>Purpose</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><em>Spring Data</em></td>
<td>Simplifying database access</td>
</tr>
<tr>
<td><em>Spring Security</em></td>
<td>Adding authentication and authorization</td>
</tr>
<tr>
<td><em>Spring Batch</em></td>
<td>Batch processing</td>
</tr>
<tr>
<td><em>Spring Cloud</em></td>
<td>Building microservices and distributed systems</td>
</tr>
<tr>
<td><em>Spring Integration</em></td>
<td>Symplifying messaging and integration between systems</td>
</tr>
</tbody>
</table>
<hr>
<h1>Initialize Spring Boot Project</h1><p>To initialize a new spring boot project you can go to <a href="https://start.spring.io/"target="_blank" rel="noopener">start.spring.io</a> and select options that suits you.</p>
<p><img src="assets/spring-project-init.png" alt="Spring Options" loading="lazy" />
<em>Img. 3 &ndash; Spring Boot options</em></p>
<p>After unpacking the <code>zip</code> arvhive we have this template project.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>.
</span></span><span style="display:flex;"><span>├── HELP.md
</span></span><span style="display:flex;"><span>├── mvnw
</span></span><span style="display:flex;"><span>├── mvnw.cmd
</span></span><span style="display:flex;"><span>├── pom.xml
</span></span><span style="display:flex;"><span>├── src
</span></span><span style="display:flex;"><span>│ ├── main
</span></span><span style="display:flex;"><span>│ │ ├── java
</span></span><span style="display:flex;"><span>│ │ │ └── us
</span></span><span style="display:flex;"><span>│ │ │ └── fymio
</span></span><span style="display:flex;"><span>│ │ │ └── store
</span></span><span style="display:flex;"><span>│ │ │ └── StoreApplication.java
</span></span><span style="display:flex;"><span>│ │ └── resources
</span></span><span style="display:flex;"><span>│ │ └── application.properties
</span></span><span style="display:flex;"><span>│ └── test
</span></span><span style="display:flex;"><span>│ └── java
</span></span><span style="display:flex;"><span>│ └── us
</span></span><span style="display:flex;"><span>│ └── fymio
</span></span><span style="display:flex;"><span>│ └── store
</span></span><span style="display:flex;"><span>│ └── StoreApplicationTests.java
</span></span><span style="display:flex;"><span>└── target
</span></span><span style="display:flex;"><span> ├── classes
</span></span><span style="display:flex;"><span> │ ├── application.properties
</span></span><span style="display:flex;"><span> │ └── us
</span></span><span style="display:flex;"><span> │ └── fymio
</span></span><span style="display:flex;"><span> │ └── store
</span></span><span style="display:flex;"><span> │ └── StoreApplication.class
</span></span><span style="display:flex;"><span> ├── generated-sources
</span></span><span style="display:flex;"><span> │ └── annotations
</span></span><span style="display:flex;"><span> ├── generated-test-sources
</span></span><span style="display:flex;"><span> │ └── test-annotations
</span></span><span style="display:flex;"><span> ├── maven-status
</span></span><span style="display:flex;"><span> │ └── maven-compiler-plugin
</span></span><span style="display:flex;"><span> │ ├── compile
</span></span><span style="display:flex;"><span> │ │ └── default-compile
</span></span><span style="display:flex;"><span> │ │ ├── createdFiles.lst
</span></span><span style="display:flex;"><span> │ │ └── inputFiles.lst
</span></span><span style="display:flex;"><span> │ └── testCompile
</span></span><span style="display:flex;"><span> │ └── default-testCompile
</span></span><span style="display:flex;"><span> │ ├── createdFiles.lst
</span></span><span style="display:flex;"><span> │ └── inputFiles.lst
</span></span><span style="display:flex;"><span> ├── surefire-reports
</span></span><span style="display:flex;"><span> │ ├── TEST-us.fymio.store.StoreApplicationTests.xml
</span></span><span style="display:flex;"><span> │ └── us.fymio.store.StoreApplicationTests.txt
</span></span><span style="display:flex;"><span> └── test-classes
</span></span><span style="display:flex;"><span> └── us
</span></span><span style="display:flex;"><span> └── fymio
</span></span><span style="display:flex;"><span> └── store
</span></span><span style="display:flex;"><span> └── StoreApplicationTests.class</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>The &ldquo;heart&rdquo; of our project is the file named <code>pom.xml</code>:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#75715e">&lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34; ?&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;project</span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">xmlns=</span><span style="color:#e6db74">&#34;http://maven.apache.org/POM/4.0.0&#34;</span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">xmlns:xsi=</span><span style="color:#e6db74">&#34;http://www.w3.org/2001/XMLSchema-instance&#34;</span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">xsi:schemaLocation=</span><span style="color:#e6db74">&#34;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&#34;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;modelVersion&gt;</span>4.0.0<span style="color:#f92672">&lt;/modelVersion&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;parent&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;artifactId&gt;</span>spring-boot-starter-parent<span style="color:#f92672">&lt;/artifactId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;version&gt;</span>4.0.2<span style="color:#f92672">&lt;/version&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;relativePath</span> <span style="color:#f92672">/&gt;</span> <span style="color:#75715e">&lt;!-- lookup parent from repository --&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/parent&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;groupId&gt;</span>us.fymio<span style="color:#f92672">&lt;/groupId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;artifactId&gt;</span>store<span style="color:#f92672">&lt;/artifactId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;version&gt;</span>0.0.1-SNAPSHOT<span style="color:#f92672">&lt;/version&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;name&gt;</span>store<span style="color:#f92672">&lt;/name&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;description&gt;</span>Store<span style="color:#f92672">&lt;/description&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;url</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;licenses&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;license</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/licenses&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;developers&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;developer</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/developers&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;scm&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;connection</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;developerConnection</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;tag</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;url</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/scm&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;properties&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;java.version&gt;</span>21<span style="color:#f92672">&lt;/java.version&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/properties&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;dependencies&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;dependency&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;artifactId&gt;</span>spring-boot-starter<span style="color:#f92672">&lt;/artifactId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/dependency&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;dependency&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;artifactId&gt;</span>spring-boot-starter-test<span style="color:#f92672">&lt;/artifactId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;scope&gt;</span>test<span style="color:#f92672">&lt;/scope&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/dependency&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/dependencies&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;build&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;plugins&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;plugin&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;artifactId&gt;</span>spring-boot-maven-plugin<span style="color:#f92672">&lt;/artifactId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/plugin&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/plugins&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/build&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;/project&gt;</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>Maven uses this file to download dependencies and build our project.</p>
<p>In the <code>source</code> folder we have the actual code for our project.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>src
</span></span><span style="display:flex;"><span>├── main
</span></span><span style="display:flex;"><span>│ ├── java
</span></span><span style="display:flex;"><span>│ │ └── us
</span></span><span style="display:flex;"><span>│ │ └── fymio
</span></span><span style="display:flex;"><span>│ │ └── store
</span></span><span style="display:flex;"><span>│ │ └── StoreApplication.java
</span></span><span style="display:flex;"><span>│ └── resources
</span></span><span style="display:flex;"><span>│ └── application.properties
</span></span><span style="display:flex;"><span>└── test
</span></span><span style="display:flex;"><span> └── java
</span></span><span style="display:flex;"><span> └── us
</span></span><span style="display:flex;"><span> └── fymio
</span></span><span style="display:flex;"><span> └── store
</span></span><span style="display:flex;"><span> └── StoreApplicationTests.java</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>The <code>StoreApplication.java</code> file is the entry point to our application.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#f92672">package</span> us.fymio.store;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> org.springframework.boot.SpringApplication;
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> org.springframework.boot.autoconfigure.SpringBootApplication;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@SpringBootApplication</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">StoreApplication</span> {
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">static</span> <span style="color:#66d9ef">void</span> <span style="color:#a6e22e">main</span>(String<span style="color:#f92672">[]</span> args) {
</span></span><span style="display:flex;"><span> SpringApplication.<span style="color:#a6e22e">run</span>(StoreApplication.<span style="color:#a6e22e">class</span>, args);
</span></span><span style="display:flex;"><span> }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>}</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>In the <code>main</code> method we have a call to <code>SpringApplication.run</code> method.</p>
<p>If we run <code>mvn clean install</code> from the root of our project we will get this result (the output is partially reduced):</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>...
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.542 s -- in us.fymio.store.StoreApplicationTests
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> Results:
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> Tests run: 1, Failures: 0, Errors: 0, Skipped: <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> --- jar:3.4.2:jar <span style="color:#f92672">(</span>default-jar<span style="color:#f92672">)</span> @ store ---
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> Building jar: /home/fymio/store/target/store-0.0.1-SNAPSHOT.jar
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> --- spring-boot:4.0.2:repackage <span style="color:#f92672">(</span>repackage<span style="color:#f92672">)</span> @ store ---
</span></span><span style="display:flex;"><span>...
</span></span><span style="display:flex;"><span>...
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> Installing /home/fymio/store/pom.xml to /home/fymio/.m2/repository/us/fymio/store/0.0.1-SNAPSHOT/store-0.0.1-SNAPSHOT.pom
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> Installing /home/fymio/store/target/store-0.0.1-SNAPSHOT.jar to /home/fymio/.m2/repository/us/fymio/store/0.0.1-SNAPSHOT/store-0.0.1-SNAPSHOT.jar
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> ------------------------------------------------------------------------
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> BUILD SUCCESS
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> ------------------------------------------------------------------------
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> Total time: 14.787 s
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> Finished at: 2026-02-19T13:16:47+03:00
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>INFO<span style="color:#f92672">]</span> ------------------------------------------------------------------------</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>So we can tell that our application was built without errors.</p>
<h1>Dependency Management</h1><p>Dependencies are third-party libraries or frameworks we use in our application. For example to build a web application we need an embedded web server like <em>Tomcat</em>, we need libraries for handling web requests building APIs, processing JSON data, logging and so on.</p>
<p>In spring boot applications instead of adding multiple individual libraries we can use a <strong>starter dependency</strong>.</p>
<p><img src="assets/spring-boot-starter-web.svg" alt="Spring Boot Starter Web" loading="lazy" />
<em>Img. 5 &ndash; Spring Boot Starter Web</em></p>
<p>To use this dependency we just need to copy the code below to our <code>pom.xml</code> file.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#f92672">&lt;dependency&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;artifactId&gt;</span>spring-boot-starter-web<span style="color:#f92672">&lt;/artifactId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;version&gt;</span>4.1.0-M1<span style="color:#f92672">&lt;/version&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;/dependency&gt;</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>So the <code>dependencies</code> section would look like this</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#f92672">&lt;dependencies&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;dependency&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;artifactId&gt;</span>spring-boot-starter<span style="color:#f92672">&lt;/artifactId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/dependency&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;dependency&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;artifactId&gt;</span>spring-boot-starter-test<span style="color:#f92672">&lt;/artifactId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;scope&gt;</span>test<span style="color:#f92672">&lt;/scope&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/dependency&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;dependency&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;artifactId&gt;</span>spring-boot-starter-web<span style="color:#f92672">&lt;/artifactId&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#75715e">&lt;!-- &lt;version&gt;4.1.0-M1&lt;/version&gt; --&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/dependency&gt;</span>
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&lt;/dependencies&gt;</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>Notice, that I commented out the version of our dependency. That&rsquo;s because it&rsquo;s a better practice to let Spring Boot decide what version of the dependency to use.</p>
<h1>Controllers</h1><p><strong>Spring MVC</strong> stands for <em>Model View Controller</em>.</p>
<p><em>Model</em> is where our application&rsquo;s data lives. It represents the business logic and is usually connected to a database or other data sources. In spring boot the model can be a simple java class.</p>
<p><em>View</em> is what the user sees. It&rsquo;s the HTML, CSS or JavaScript that&rsquo;s rendered in the browser. In Spring MVC views can be static files or dynamically generated.</p>
<p><em>Controller</em> is like a traffic controller. It handles incoming requests from the user, interacts with the model to get data and then tells the view what to display.</p>
<p>Let&rsquo;s add a new java class called <code>HomeController</code>. It will be located at <code>src/main/java/us/fymio/store/HomeController.java</code>.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#f92672">package</span> us.fymio.store;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">HomeController</span> {}</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>To make this a controller we have to decorate it with the controller annotation. And import the <code>Controller</code> from <code>org.springframework.stereotype</code> package.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#f92672">package</span> us.fymio.store;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> org.springframework.stereotype.Controller;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@Controller</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">HomeController</span> {}</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>Let&rsquo;s now add an <code>index</code> method. When we send a request to the root of our website we want this method to be called. Also we need to add another special annotation to this method.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#f92672">package</span> us.fymio.store;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> org.springframework.stereotype.Controller;
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> org.springframework.web.bind.annotation.RequestMapping;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@Controller</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">HomeController</span> {
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">@RequestMapping</span>(<span style="color:#e6db74">&#34;/&#34;</span>) <span style="color:#75715e">// this represents the root of our website</span>
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">public</span> String <span style="color:#a6e22e">index</span>() {
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">return</span> <span style="color:#e6db74">&#34;index.html&#34;</span>; <span style="color:#75715e">// this returns the view</span>
</span></span><span style="display:flex;"><span> }
</span></span><span style="display:flex;"><span>}</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>Now we need to create this view. We add the <code>index.html</code> at <code>src/main/resources/static/index.html</code>. For now let&rsquo;s just print &ldquo;Hello world!&rdquo;.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-html" data-lang="html"><span style="display:flex;"><span><span style="color:#75715e">&lt;!doctype html&gt;</span>
</span></span><span style="display:flex;"><span>&lt;<span style="color:#f92672">html</span> <span style="color:#a6e22e">lang</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;en&#34;</span>&gt;
</span></span><span style="display:flex;"><span> &lt;<span style="color:#f92672">head</span>&gt;
</span></span><span style="display:flex;"><span> &lt;<span style="color:#f92672">meta</span> <span style="color:#a6e22e">charset</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;UTF-8&#34;</span> /&gt;
</span></span><span style="display:flex;"><span> &lt;<span style="color:#f92672">meta</span> <span style="color:#a6e22e">name</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;viewport&#34;</span> <span style="color:#a6e22e">content</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;width=device-width, initial-scale=1.0&#34;</span> /&gt;
</span></span><span style="display:flex;"><span> &lt;<span style="color:#f92672">title</span>&gt;View&lt;/<span style="color:#f92672">title</span>&gt;
</span></span><span style="display:flex;"><span> &lt;/<span style="color:#f92672">head</span>&gt;
</span></span><span style="display:flex;"><span> &lt;<span style="color:#f92672">body</span>&gt;
</span></span><span style="display:flex;"><span> &lt;<span style="color:#f92672">h1</span>&gt;Hello world!&lt;/<span style="color:#f92672">h1</span>&gt;
</span></span><span style="display:flex;"><span> &lt;/<span style="color:#f92672">body</span>&gt;
</span></span><span style="display:flex;"><span>&lt;/<span style="color:#f92672">html</span>&gt;</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>Now let&rsquo;s build our application using <code>mvn spring-boot:run</code>.</p>
<p>As we can see from the logs:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>2026-02-19T14:55:23.948+03:00 INFO <span style="color:#ae81ff">36752</span> --- <span style="color:#f92672">[</span>store<span style="color:#f92672">]</span> <span style="color:#f92672">[</span> main<span style="color:#f92672">]</span> o.s.boot.tomcat.TomcatWebServer : Tomcat initialized with port <span style="color:#ae81ff">8080</span> <span style="color:#f92672">(</span>http<span style="color:#f92672">)</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>It means that our app is up and running at <a href="http://localhost:8080/"target="_blank" rel="noopener">localhost:8080</a>.</p>
<p><img src="assets/hello-world.png" alt="Hello world!" loading="lazy" />
<em>Img. 7 &ndash; Our app is up and running!</em></p>
<h1>Configuring Application Properties</h1><p>Let&rsquo;s take a look at our <code>application.properties</code> file located at <code>src/main/resources/application.properties</code>.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-properties" data-lang="properties"><span style="display:flex;"><span><span style="color:#a6e22e">spring.application.name</span><span style="color:#f92672">=</span><span style="color:#e6db74">store</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>To use this property in our code we can use the <code>@Value</code> annotation.</p>
<p>Let&rsquo;s change our <code>HomeController</code> class so it prints the name of our application.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#f92672">package</span> us.fymio.store;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> org.springframework.beans.factory.annotation.Value;
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> org.springframework.stereotype.Controller;
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> org.springframework.web.bind.annotation.RequestMapping;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@Controller</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">HomeController</span> {
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">@Value</span>(<span style="color:#e6db74">&#34;${spring.application.name}&#34;</span>)
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">private</span> String appName;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">@RequestMapping</span>(<span style="color:#e6db74">&#34;/&#34;</span>) <span style="color:#75715e">// this represents the root of our website</span>
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">public</span> String <span style="color:#a6e22e">index</span>() {
</span></span><span style="display:flex;"><span> System.<span style="color:#a6e22e">out</span>.<span style="color:#a6e22e">println</span>(<span style="color:#e6db74">&#34;application name = &#34;</span> <span style="color:#f92672">+</span> appName);
</span></span><span style="display:flex;"><span> <span style="color:#66d9ef">return</span> <span style="color:#e6db74">&#34;index.html&#34;</span>; <span style="color:#75715e">// this returns the view</span>
</span></span><span style="display:flex;"><span> }
</span></span><span style="display:flex;"><span>}</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<p>And as we can see after running our application there is a <code>store</code> printed out in the terminal.</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">
<div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>...
</span></span><span style="display:flex;"><span>2026-02-19T15:32:37.507+03:00 INFO <span style="color:#ae81ff">41536</span> --- <span style="color:#f92672">[</span>store<span style="color:#f92672">]</span> <span style="color:#f92672">[</span>nio-8080-exec-1<span style="color:#f92672">]</span> o.s.web.servlet.DispatcherServlet : Initializing Servlet <span style="color:#e6db74">&#39;dispatcherServlet&#39;</span>
</span></span><span style="display:flex;"><span>2026-02-19T15:32:37.509+03:00 INFO <span style="color:#ae81ff">41536</span> --- <span style="color:#f92672">[</span>store<span style="color:#f92672">]</span> <span style="color:#f92672">[</span>nio-8080-exec-1<span style="color:#f92672">]</span> o.s.web.servlet.DispatcherServlet : Completed initialization in <span style="color:#ae81ff">2</span> ms
</span></span><span style="display:flex;"><span>application name <span style="color:#f92672">=</span> store
</span></span><span style="display:flex;"><span>...</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
<button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
>
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
</button>
</div>
</div>
<h1>Dependency injection</h1><p>Imagine we are building an E-Commerce application that handles placing orders. When the order is placed, the customer&rsquo;s payment needs to be processed so order service depends on a payment service like stripe payment service. In this case we can say that order service is <em>dependent</em> or <em>coupled to</em> stripe payment service.</p>
<p><img src="assets/depends-on-coupled-to.svg" alt="Depends on/Coupled to relation" loading="lazy" />
<em>Img. 8 &ndash; Depends On/Coupled To relation.</em></p>
</div> </div>
<div class="hx:mt-16"></div> <div class="hx:mt-16"></div>

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" dir="ltr"><head> <html lang="en" dir="ltr"><head>
<meta name="generator" content="Hugo 0.155.3"><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script> <meta name="generator" content="Hugo 0.156.0"><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="robots" content="noindex, nofollow" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="robots" content="noindex, nofollow" />
<link rel="icon shortcut" href="/favicon.ico" sizes="32x32" /> <link rel="icon shortcut" href="/favicon.ico" sizes="32x32" />