Create a Custom Spring Boot Starter
Build a custom Spring Boot 4 starter with conditional auto-configuration, configuration properties, a consuming app, and tests for defaults and bean overrides.
Build a custom Spring Boot 4 starter with conditional auto-configuration, configuration properties, a consuming app, and tests for defaults and bean overrides.
Build a Spring Boot and Vaadin CRUD app with a Grid, a validated form and Spring Data JPA. Complete code for every file, run steps and real screenshots.
Thymeleaf renders server-side HTML pages from natural templates in a Spring Boot application. This tutorial builds a playlist app on Spring Boot 4.1.1 and Thymeleaf 3.1.5 with loops, conditions, links, validated forms, fragments, i18n and date and number formatting, and tests the views with MockMvcTester.
Spring Boot 4 is the major release built on Spring Framework 7, Jakarta EE 11 and Jackson 3, with Java 17 as the minimum. This tutorial builds one Spring Boot 4.1.1 app that shows the modular starters, JSpecify null-safety with NullAway, API versioning, HTTP service clients with @Retryable, Jackson 3, MockMvcTester and RestTestClient tests, virtual threads, OpenTelemetry traces and the 4.1 additions, and ends with an upgrade checklist from Spring Boot 3.5.
Schedule jobs in Spring Boot 4 with Quartz 2.5: inject Spring beans into jobs, use simple and cron triggers, handle misfires, chain jobs with listeners, persist and cluster jobs with the JDBC job store, and manage them from the actuator endpoint.
Connect Spring Boot 4.1 to Elasticsearch 9 with Spring Data Elasticsearch 6.1 and the new Java client: run Elasticsearch in Docker, map documents, search with repositories and NativeQuery, and test with Testcontainers.
A hands-on Kubernetes guide for Java developers: deploy a Spring Boot API and PostgreSQL to a local kind cluster and learn pods, Deployments, Services, Ingress, ConfigMaps, Secrets, volumes and StatefulSets with real kubectl output.
Upload an .xlsx class roster to a Spring Boot endpoint, read it with Apache POI, validate every row with Bean Validation and save the valid rows in JDBC batches. Includes a JSON error report, duplicate checks, a SAX reader for large files with measured heap, upload limits and MockMvc tests.
Set up Hibernate 7.4 in a Spring Boot 4.1 application: the JPA starter, datasource and JPA properties, entities, Spring Data repositories, transactions, the Session API, SQL logging, tests on H2 and MySQL, and the Hibernate 7 upgrade changes.
One property, spring.threads.virtual.enabled=true, moves Spring Boot requests, @Async methods and scheduled tasks to virtual threads. A weather API measured against platform threads and WebFlux, plus pinning and monitoring on Java 25.
Spring Boot @Autowired connects the classes together without tight coupling, making application modular, testable, and easy to maintain.
Since version 3.4, Spring Boot will provide native support for structured logging in the most common and popular formats, such as JSON and XML.
1. Problem When writing tests that depend on H2 database in a Spring boot application, we may encounter the CommandAcceptanceException: Error executing DDL. The root cause exception will be org.h2.jdbc.JdbcSQLSyntaxErrorException in the logs. The exception stack trace will look something like this: If you are trying to run unit tests …
Learn to create a REST API controller using @RestController in a Spring Boot application, and add method validation, error handling and unit tests.
Learn to Spring Data JPA module and work with JpaRepository interface for performing the CRUD operations in underlying databases in a Spring Boot application.
Learn to write Spring Boot RESTs that help in downloading the Excel files (.xlsx) either stored in the server or generating and then sending it.
Learn to create generic and custom error pages for specific HTTP error codes in a Spring Boot application with configuration examples.
By leveraging Spring @Import and @ImportResource annotations, we can create more modular, maintainable, and flexible Spring Boot applications.
Spring Boot provides various ways to load property files such as default application.properties, spring profiles, custom property files, environment variables, and system properties.
Learn to create a Spring Boot project with Gradle from scratch, configure the build script, create a Spring Boot application class, and run the application.
In Spring tutorial explores transaction-aware caching using transactionAware property and TransactionAwareCacheManagerProxy class with example.
This guide explores the step-by-step process of containerization and running a Spring Boot application with PostgreSQL database using Podman.
Learn to handle REST API timeouts on the server side using Spring boot MVC async, Resilience4j, @Transactional, RestTemplate and WebClient with examples.
Learn to display images from different sources (e.g., resources directory or database) using the Thymeleaf view templates in a Spring Boot application.
Spring Boot is an open-source framework that simplifies the development of stand-alone, production-grade Spring-based MVC applications and microservices.
Learn to create Jasper reports in a Spring boot application, step by step, by configuring JasperReport library, loading the report templates, fill the data into reports and finally export the filled reports into a variety of formats.
Learn to create a Kafka Streams application using Spring Boot. Also, learn about Topology and Processor and unit test the topology design.
Learn to write a REST API in Spring Boot that can handle single file and multiple file uploads. Also learn to validate the file sizes and types.
Learn to configure the logging levels for different packages and classes in a Spring boot application using properties, YAML and XML configurations.
Learn to build REST APIs in a Spring boot application with request validation, error handling, testing and API documentation with examples.
Learn to configure Spring boot application and Apache Kafka Producer, and Consumer, handle Kafka errors and retry in case of failures.
Learn to design and implement a Spring Boot REST API that accepts long-running tasks and publishes the execution progress to a Kafka topic.
Learn to call OpenAI ChatGPT APIs in Spring Boot RestTemplate or WebClient with an example. Also, log the requests and responses for debugging.
Learn the most common solutions for the Spring boot application closing automatically after start, with exit code 0 and no exceptions logs.
Since Spring Boot 3.1, @ServiceConnection is used to provide connection details to a remote service that takes precedence over details in the properties file.
Learn to use Spring boot docker compose module, customize the compose file and container lifecycle with an example.
Learn to use integrate DynamoDB using Spring-cloud-aws module and its DynamoDbTemplate and DynamoDbEnhancedClient beans with examples.
Step by step, we will learn to deploy a Spring Boot application to AWS Elastic Beanstalk which uses RDS for persisting the records in the database.
By combining the portability and flexibility of Docker containers with AWS’s reliable and scalable infrastructure, we can take our Spring Boot applications to new heights. In this comprehensive guide, we’ll show exactly how to deploy a Dockerized Spring Boot app to AWS ECS from start to finish. 1. Introduction to …
Learn to use the test container library (KeycloakContainer) to start keycloak server as a docker container while unit testing with JUnit and Spring boot.
This Spring security tutorial discusses using Keycloak and Spring Security OAuth2 to implement token-based authentication in a spring boot app.
Learn to configure bulkhead and rate limiting using Resilience4j 2 in a Spring boot 3 application, and testing with Apache JMeter.
Spring boot, by default, configures Jackson for parsing objects to JSON. We can use Jackson’s XML module or JAXB to configure the XML support.
Learn to execute SQL scripts to load data (e.g. import.sql, schema.sql or data.sql) during startup of a Spring boot application or tests.
Learn to access DynamoDB from a Spring Boot app and perform CRUD, batch and transaction operations using DynamoDBMapper or JPA Repository.
Learn to create an application from scratch using REST APIs created with Spring boot and the user interface created with Vue.js. We will build a simple employee management application with Create, Read, Update, and Delete (CRUD) functionality. 1. Application Overview In the application, the home screen will present a list …
Learn to solve the ‘JdbcSQLSyntaxErrorException schema not found’ error in a Spring boot app that uses the H2 database for CRUD operations.
In this post, we will learn how to configure and manage multiple datasources using properties configuration and defining custom beans using Java annotations in Spring Boot. Note that this requirement differs from having separate datasource in test, dev and prod environments. Here, we are using multiple datasources in the same …
Learn the internal working of SpringBootServletInitializer and how to use it to deploy a Spring Boot application to an external server.
Learn to Spring Boot API to accept multiple file uploads, store in a folder, save file details in database and build a React UI to interact.
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.