E-Book, Englisch, 270 Seiten
Turnquist Learning Spring Boot 3.0
3. Auflage 2024
ISBN: 978-1-80324-989-6
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection
Simplify the development of production-grade applications using Java and Spring
E-Book, Englisch, 270 Seiten
ISBN: 978-1-80324-989-6
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection
Spring Boot 3 brings more than just the powerful ability to build secure web apps on top of a rock-solid database. It delivers new options for testing, deployment, Docker support, and native images for GraalVM, along with ways to squeeze out more efficient usage of existing resources.
This third edition of the bestseller starts off by helping you build a simple app, and then shows you how to secure, test, bundle, and deploy it to production. Next, you'll familiarize yourself with the ability to go 'native' and release using GraalVM. As you advance, you'll explore reactive programming and get a taste of scalable web controllers and data operations. The book goes into detail about GraalVM native images and deployment, teaching you how to secure your application using both routes and method-based rules and enabling you to apply the lessons you've learned to any problem. If you want to gain a thorough understanding of building robust applications using the core functionality of Spring Boot, then this is the book for you.
By the end of this Spring Boot book, you'll be able to build an entire suite of web applications using Spring Boot and deploy them to any platform you need.
Fachgebiete
Weitere Infos & Material
Table of Contents - Core Features of Spring Boot
- Creating a Web Application with Spring Boot
- Querying for Data with Spring Boot
- Securing an Application with Spring Boot
- Testing with Spring Boot
- Configuring an Application with Spring Boot
- Releasing an Application with Spring Boot
- Going Native with Spring Boot
- Writing Reactive Web Controllers
- Working with Data Reactively
Preface
This book is designed for both novices and experienced Spring developers. It will teach you how to build Java applications without wasting time on infrastructure and other tedious details. Instead, it will help you focus on building web apps on top of real databases, locked down with modern security practices.
On top of that, you’ll discover multiple ways to carry an app to production. If that’s not enough, it even includes secret ways (okay, not really secret) at the end to squeeze more out of your existing servers (or cloud) by picking up and running with reactive programming.
Who this book is for
This book is designed for both novices and experienced Spring developers who want to get their hands on Spring Boot 3.0. You should have a rudimentary understanding of Java, preferably Java 8 or higher. Being familiar with lambda functions, method references, record types, and the new-and-improved collections API found in Java 17 is a bonus, but not required.
Having used previous versions of Spring Boot (1.x, 2.x) is not required but would be handy.
What this book covers
, , is where you discover the charm of Spring Boot with its fundamental features to work with you as you build your app.
, , teaches you how to craft the web layer for a Java app with ease, with both server-side and client-side options.
, , shows you how to get the most out of your database with Spring Data.
, , shows you how to use Spring Security’s cutting-edge features to lock down your app from bad guys, inside and out.
, , teaches you how to build confidence in your systems through testing with mocks and embedded databases, and even using Testcontainers combined with real databases.
, , shows you ways to tune and adapt your app once it’s built.
, , helps you discover multiple ways to take your app to production and put it in the hands of your users.
, , shows you how to speed up your app by leaps and bounds using native images that start in subsecond time and don’t hog all your resources.
, , teaches you how easy it is to write reactive web controllers and how they can be your key to a more efficient app.
, , helps you discover how to query for data reactively using R2DBC and see how efficient your app can be.
To get the most out of this book
Spring Boot 3.0 is built on Java 17. By using sdkman (https://sdkman.io), you can easily install the version of Java needed. In , we’ll include instructions on how to use sdkman to install a specific flavor of Java 17 that supports building native images for GraalVM. While it’s possible to write code using a barebones text editor, any modern IDE (see the following list) will greatly enhance the coding experience. Check out the one that works best for you.
| Software/hardware covered in the book | Operating system requirements |
| sdkman (for Java 17) (https://sdkman.io) | Windows, macOS, or Linux |
| Any modern IDE will help with writing code:
| Windows, macOS, or Linux |
VS Code and Spring Tool Suite are free. IntelliJ IDEA has a Community Edition and an Ultimate Edition. The Community Edition is free, but some of the Spring-specific features require purchasing the Ultimate Edition. There is a 30-day trial to give it a spin.
If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.
This book, however, isn’t the end of your journey into building Spring Boot apps. Check out my YouTube channel, (http://bit.ly/3uSPLCz), where I publish videos all the time on Spring Boot and software engineering. There are also additional resources at https://springbootlearning.com to help you write better apps!
Download the example code files
You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Learning-Spring-Boot-3.0. If there’s an update to the code, it will be updated in the GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots and diagrams used in this book. You can download it here: https://packt.link/FvE6S.
Conventions used
There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “This can be done by first adding an application.properties file to our src/main/resources folder.”
A block of code is set as follows:
@Controller public class HomeController { private final VideoService videoService; public HomeController(VideoService videoService) { this.videoService = videoService; } @GetMapping("/") public String index(Model model) { model.addAttribute("videos", videoService.getVideos()); return "index"; } }When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
@Bean SecurityFilterChain configureSecurity(HttpSecurity http) { http.authorizeHttpRequests() .requestMatchers("/login").permitAll() .requestMatchers("/", "/search").authenticated() .anyRequest().denyAll() .and() .formLogin() .and() .httpBasic(); return http.build(); }Any command-line input or output is written as follows:
$ cd ch7
$ ./mvnw clean spring-boot:build-image
Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “To do that, go to the Dependencies section.”
Tips or important notes
Appear like this.
Get in touch
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.
Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Share Your Thoughts
Once you’ve read




