Sigrid  Farrell

Sigrid Farrell

1621504380

Spring Boot Serving Static Web Content and Resources

every application has static resources like html , css and javascript .

There are variety of ways to handle static content in spring boot . We will talk about these different ways below . How to Handle Static Content in Spring Boot .

There are variety of ways listed below

  • Spring Default Way using application.Properties
  • customizing Spring static resources path
  • Customizing Using Java Configurations

#spring boot #spring boot

What is GEEK

Buddha Community

Spring Boot Serving Static Web Content and Resources
Sigrid  Farrell

Sigrid Farrell

1621504380

Spring Boot Serving Static Web Content and Resources

every application has static resources like html , css and javascript .

There are variety of ways to handle static content in spring boot . We will talk about these different ways below . How to Handle Static Content in Spring Boot .

There are variety of ways listed below

  • Spring Default Way using application.Properties
  • customizing Spring static resources path
  • Customizing Using Java Configurations

#spring boot #spring boot

Were  Joyce

Were Joyce

1620751200

How to Configure the Interceptor With Spring Boot Application

In the video in this article, we take a closer look at how to configure the interceptor with the Spring Boot application! Let’s take a look!

#spring boot #spring boot tutorial #interceptor #interceptors #spring boot interceptor #spring boot tutorial for beginners

Were  Joyce

Were Joyce

1620720872

Spring vs Spring BooDifference Between Spring and Spring Boot

As an extension of the Spring Framework, Spring Boot is widely used to make development on Spring faster, more efficient and convenient. In this article, we will look at some of the parameters were using Spring Boot can drastically reduce the time and effort required in application development.

What is Spring?

Spring Boot

Difference between Spring and Spring Boot

Advantages of Spring Boot over Spring

Conclusion

#full stack development #spring #spring and spring boot #spring boot

Sigrid  Farrell

Sigrid Farrell

1622601303

How to Configure log4j2 In a Spring Boot Application? | Spring Boot Logging [Video]

Configuring log4j2 is really quick and simple; this tutorial video explains the entire process in only 5 minutes, while you wait for your coffee to brew.

In the video below, we take a closer look at the How to configure log4j2 in the Spring boot application using log4j2.xml? | Spring Boot logging. Let’s get started!

#java #spring boot #video #log4j #spring boot tutorial #spring boot tutorial for beginners

Lindsey  Koepp

Lindsey Koepp

1596429780

Spring Web Flux UI with Spring Security

This is an example of UI application built using Spring Web Flux and Thymeleaf templates. It has a login page and on authentication shows a list of customers. It interacts with Spring Gateway service which acts as the backend for this frontend.

The UI application has the following pages:

  1. Login Page - The default spring security login page
  2. Customer List - This page shows a list of customers
  3. Customer List Reactive - Another way of showing the same customer list with web flux reactive call

Along with this, other services involved are:

  1. Customer Service application - A simple microservice which has the rest endpoint to return list of customers.
  2. Spring Gateway application - A Spring Cloud gateway service which does the authentication and routing.
  3. Discovery Service - Both the customer microservice and Spring Gateway microservice are registered with this service.

All the components here are developed using Spring Boot.

The flow from UI to the Customer Service application is shown below:

  1. The UI service calls the Gateway service for authentication.
  2. After authentication, it lands on a page that shows the list of customers.
  3. Another link is available to retrieve the customers list in a reactive way.

User and customer database

The codebase for this whole setup is available here.

To run this application, open command prompt or terminal and go to the corresponding folder where pom files are present and run the below command.

PowerShell

mvn spring-boot:run

Start the services in the following order:

  1. Spring Discovery Service - This runs on port 8761
  2. Customer Service - This runs on port 8082. It has its own H2 database. When application is started, a “customer” table is created with 50 customer records. The names for the customers have been taken from here.
  3. Gateway Service - This runs on port 8080. It uses feign client to interact with Customer Service. It also has H2 dtabase. When the application is started, a “user” and “user_role” table are created with some default entries.
  4. Spring Web Flux application - This runs on port 9080. The html has been built using Thymeleaf and bootstrap.

After all the services have started, open “http://localhost:9080/login” in your browser. You should see the below window. Enter “user1” for Username and Password.

Sign in page

#web dev #authentication #web app #spring boot 2 #microservice communication #spring web flux