Spring Boot

Related Tags

Tutorials

Spring Boot Logging with Lombok

Project lombok can also be used to configure logging in spring boot applications and thus removing the boilerplate code for getting the logger instance.

Spring Boot and Ehcache 3 Example

Learn to configure Ehcahce 3 with Spring Boot 2.x and Spring Boot 3.x applications, use @Cacheable annotation and log caching events.a

Spring Boot Embedded Server Logs

Learn to enable and customize the internal and access logs generated for embedded servers in Spring boot e.g. tomcat, jetty & undertow.

Spring Boot Mockito JUnit Example: Unit Test a Service

Unit test a Spring Boot service with JUnit and Mockito. Mock the repository with @Mock, build the service with @InjectMocks, stub with when().thenReturn() and check calls with verify(). Also covers @MockitoBean in @SpringBootTest, thenThrow, ArgumentCaptor, BDDMockito, strict stubs and the Mockito Java agent on Java 21+.

Spring Boot MockMvc Example with @WebMvcTest and MockitoBean

Test Spring Boot REST controllers with MockMvc and @WebMvcTest. Replace the service with a @MockitoBean mock and send GET, POST, PUT and DELETE requests with JSON. Then check status codes, validation errors and @RestControllerAdvice responses. Also covers MockMvcTester (AssertJ) and real andDo(print()) output on Spring Boot 4.1.1.

Spring Boot Multi-Module Maven Project

Build a Spring Boot 4 multi-module Maven project with a reusable library JAR and executable API. Run the reactor build, focused tests, and HTTP example.

Securing Spring Boot REST API with Basic Auth

Learn to use basic authentication to secure the REST APIs created in a Spring boot application. The secured API will ask for user authentication credentials before giving access to the API response. 1. Maven Dependency The simplest way to add all required jars is to add the latest version of …

Spring Boot Log4j2.properties Example

Spring boot log4j2 properties configuration example. This enables log4j logging into any spring boot application and start logging into console or file.

Spring Boot Caching with Example

Learn to enable and configure caching in a Spring boot application using @EnableCaching, @Cacheable, @CachePut and @CacheEvict annotations.

Spring Boot Log4j2.xml Example

Spring boot log4j2.xml configuration example of configuring log4j2 with spring boot2 project and adding logging support to the application.

Spring Boot war Packaging Example

In Spring boot applications, the default packaging is jar which is deployed in embedded servers. Learn to generate a war file for deployment.

Spring Boot HATEOAS Links Example

In this Spring Boot HATEOAS example, we will learn to add HATEOAS (Hypertext as the Engine of Application State) links to resource representations returned from REST APIs in a Spring boot application. 1. What is HATEOAS? HATEOAS is one of the constraints of the REST architectural style first presented by …

Spring Boot Actuator Example

Spring Boot 3 Actuator example to discuss default auto-configuration and monitor and manage our applications in a production-ready manner.

Spring boot RSS feed with rome

In this tutorial, learn to create and consume RSS and Atom feed from spring boot application. You must have seen this in form of text or image buttons on various websites (like our RSS feed) inviting you to “Subscribe via RSS.” RSS is simple syndication API – often referred as …

Spring Boot CORS Configuration Examples

Configure Spring Boot CORS for controller methods, path groups and Spring Security. Tested examples show allowed origins, preflight, rejected origins and authentication.

Spring Boot SOAP Webservice Example

In this spring boot soap tutorial, we will focus only in the Spring boot related configurations to see how easily we can create our contract first SOAP webservice.

Spring Boot SSL [https] Example

In this spring boot example, learn to configure web application to run on SSL (HTTPS) with self-signed certificate. Also learn to create SSL cert, as well.

Adding Role Based Security with Spring Boot REST APIs

Learn to create JAX-RS 2.0 REST APIs using Spring Boot and Jersey framework, and add role based security using JAX-RS annotations e.g. @PermitAll, @RolesAllowed or @DenyAll. Table of Contents Project Structure Create REST APIs Secure REST APIs with JAX-RS Annotations Write security filter using JAX-RS ContainerRequestFilter Demo Project Structure The …

Create Jersey REST APIs with Spring Boot

Learn to configure and create JAX-RS 2.0 REST APIs using Spring Boot and Jersey framework. This example application uses Jersey’s ServletContainer to deploy the REST APIs.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.