Spring Boot - Getting Started

Video description

The Spring Framework is the leading alternative to Oracle’s Java EE offering. Spring Boot is the best option to start developing Spring applications with less code and a better development and operations experience.

This lesson is aimed at providing someone having a Java background with the necessary expertise to write a web-based application from scratch that stores data in a relational database and offers a REST-based API and a HTML interface.

We start by creating a new project and exploring the already provided test support. We then move on to add our first Web MVC controller and of course we add tests for this as well. With that knowledge we start to write our sample application and start with a REST-based API. Then, we add data storage via JPA and Spring’s JdbcTemplate.

Further on, we create an HTML interface with thymeleaf and add input validation to both APIs. Spring security is the next topic we explore to secure our application from malicious users. At the end we are going to learn how to configure our application, monitor it, and check out some advanced topics regarding Spring configuration classes and the Spring Expression Language (SpEL).

After completing this course, you will be able to write a maintainable application from scratch that can be deployed and operated with ease.

What You Will Learn

  • Bootstrap and WebMVC first glance
  • Creating an API and storing data into the database
  • Creating a HTML based interface with thymeleaf
  • Securing the app and preparing the application for the release

Audience

This course can be beneficial for novice Spring developers, web developers and Spring enthusiast. This will help them dive-in and understand core basics concepts of Spring Boot.

About The Author

Patrick Cornelien: Patrick Cornelien is a software developer and the founder and CEO of the Orchit GmbH and KulinariWeb GmbH. He has written several applications in various languages and platforms, and specializes in microservice-based applications and transition of monolithic applications into microservices. He has been using the Spring Framework since 2009. He has organized code retreats and open space conferences, because he likes to learn and teach new things in the field of (agile) software development.

Table of contents

  1. Chapter 1 : Bootstrap…
    1. The Course Overview
    2. Creating a small project
    3. The Spring context
    4. Spring testing
  2. Chapter 2 : WebMVC – a First Glance
    1. Adding WebMVC dependencies
    2. Adding interactivity
    3. Adding interactivity – II
    4. Spring MVC testing
    5. Spring WebMVC testing – II
  3. Chapter 3 : Creating an API
    1. Adding a bookmark
    2. Adding HATEOAS
    3. Fetching a bookmark
    4. Getting all bookmarks
    5. Update a bookmark
    6. Deleting a bookmark
    7. Closing, ResponseStatus, and ResourceAssembler
  4. Chapter 4 : Storing Data in a Database
    1. Adding JPA dependencies
    2. JPA entity and DAO
    3. Adding Flyway for schema migration
    4. Switching to JdbcTemplate
    5. Switching to JdbcTemplate – II
    6. Transactions
  5. Chapter 5 : Creating an HTML-based Interface with Thymeleaf
    1. Adding Thymeleaf
    2. Adding some more fields to the Bookmark class
    3. Adding bookmark details page
    4. Bookmark list
    5. Deleting a bookmark
    6. Adding a bookmark edit form
  6. Chapter 6 : Validating input
    1. Adding validation dependencies
    2. Enabling validation on the model
    3. Activating validation in the REST API
    4. Adding an add form
    5. Adding validation to the HTML UI
  7. Chapter 7 : Securing the App
    1. Adding Spring Security dependencies
    2. Adding the login form
    3. Adding roles and authorization
    4. Adding Spring Security to the HTML UI
  8. Chapter 8 : Preparing the Application for the Release
    1. Spring profiles
    2. Configuration property classes
    3. Spring Boot Actuator
    4. Spring Boot Actuator - II
  9. Chapter 9 : Peeking under the Hood
    1. Advanced Spring configuration
    2. Spring expression language
    3. Spring expression language – II
    4. Spring bean scopes
    5. Spring bean scopes – II
    6. Common configuration options
    7. Common configuration options – II

Product information

  • Title: Spring Boot - Getting Started
  • Author(s): Patrick Cornelien
  • Release date: July 2017
  • Publisher(s): Packt Publishing
  • ISBN: 9781788298636