Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Spring Boot Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
Spring Boot Cookbook

Spring Boot Cookbook

By : Alex Antonov
4.6 (5)
close
close
Spring Boot Cookbook

Spring Boot Cookbook

4.6 (5)
By: Alex Antonov

Overview of this book

Spring Boot is Spring's convention-over-configuration solution. This feature makes it easy to create Spring applications and services with absolute minimum fuss. Spring Boot has the great ability to be customized and enhanced, and is specifically designed to simplify development of a new Spring application. This book will provide many detailed insights about the inner workings of Spring Boot, as well as tips and recipes to integrate the third-party frameworks and components needed to build complex enterprise-scale applications. The book starts with an overview of the important and useful Spring Boot starters that are included in the framework, and teaches you to create and add custom Servlet Filters, Interceptors, Converters, Formatters, and PropertyEditors to a Spring Boot web application. Next it will cover configuring custom routing rules and patterns, adding additional static asset paths, and adding and modifying servlet container connectors and other properties such as enabling SSL. Moving on, the book will teach you how to create custom Spring Boot Starters, and explore different techniques to test Spring Boot applications. Next, the book will show you examples of configuring your build to produce Docker images and self-executing binary files for Linux/OSX environments. Finally, the book will teach you how to create custom health indicators, and access monitoring data via HTTP and JMX.
Table of Contents (9 chapters)
close
close
8
Index

Automatically configuring the database schema and populating it with data


Earlier in the book, in Chapter 2, Configuring Web Applications, we manually added a few entries to the database in the StartupRunner's run(…) method. While doing so programmatically can be a quick and easy way to get something going very quickly, in the long run, it is not really a good idea to do so—especially when you are dealing with a large amount of data. It is also a good practice to separate the database preparations, changes, and other configurations from the rest of the running application code, even if it is setting up the test cases. Thankfully, Spring has provided you with the support to make this task fairly easy and straightforward to solve.

We will continue with the state of the application as we had left it in the previous recipe. Spring provides us with a couple of ways to define how both the structure and data should be populated in the database. The first way relies on using Hibernate to automatically...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Spring Boot Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon