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 5.0 Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
Spring 5.0 Cookbook

Spring 5.0 Cookbook

By : Sherwin John C. Tragura
3.5 (2)
close
close
Spring 5.0 Cookbook

Spring 5.0 Cookbook

3.5 (2)
By: Sherwin John C. Tragura

Overview of this book

The Spring framework has been the go-to framework for Java developers for quite some time. It enhances modularity, provides more readable code, and enables the developer to focus on developing the application while the underlying framework takes care of transaction APIs, remote APIs, JMX APIs, and JMS APIs. The upcoming version of the Spring Framework has a lot to offer, above and beyond the platform upgrade to Java 9, and this book will show you all you need to know to overcome common to advanced problems you might face. Each recipe will showcase some old and new issues and solutions, right from configuring Spring 5.0 container to testing its components. Most importantly, the book will highlight concurrent processes, asynchronous MVC and reactive programming using Reactor Core APIs. Aside from the core components, this book will also include integration of third-party technologies that are mostly needed in building enterprise applications. By the end of the book, the reader will not only be well versed with the essential concepts of Spring, but will also have mastered its latest features in a solution-oriented manner.
Table of Contents (14 chapters)
close
close

Installing Java Development Kit 1.8

The book will be using JDK 1.8, which has the support to run Spring 5.0. This version of Java supports @FunctionalInterface and lambda expressions, which are necessary concepts being showcased in this framework. A @FunctionalInterface is an interface with exactly one abstract method that may lead to its instantiation through lambda expressions. Lambda expressions are used to implement anonymous inner classes, avoiding too much bulk in the codes.

Moreover, JDK 1.8 has java.util.stream APIs that can work with collections and NIO 2.0, using stream operations such as filter, map, and reduce. These stream APIs work in sequential and parallel executions. In the area of concurrency, this JDK provides some very essential enhancements on ConcurrentHashMap for its forEach, forEachEntry, forEachKey, forEachValue, compute, merge, reduce, and search methods. Also some changes were done on the object creation of CompletableFuture and Executors.

Getting started

How to do it...

To download JDK 1.8, perform the following steps:

  1. Visit the preceding Oracle's page for downloads.
  2. On that page, click the JDK Download link. After the click, you will see the content page for JDK 1.8 installers as shown in the following image:
  1. Select Accept License Agreement by clicking its radio button.
  2. Start downloading the JDK depending on the operating system and architecture of your development machine. In the case of this book, we will be choosing the option jdk-8u112-windows-x64 since the operating system used by this book will be 64-bit.
  3. After saving the installer into the filesystem, run the installer and proceed with a series of installation wizards for JDK configuration with the inclusion of some JRE installation to your system.
  4. This is optional but it is recommended you create an environment variable JAVA_HOME for your newly installed JDK 1.8.112. On Windows operating systems:
    1. Open the System section of the Control Panel.
    2. Select the Advanced System Settings link. Windows 10 will prompt you with a User Account Control dialog box if you are not an administrator.
    3. Create a system variable JAVA_HOME and assign the location of the JDK directory to it.
    4. Look for the path system variable and append the following line: %JAVA_HOME\%bin.
  5. Verify if all classpath settings are created correctly. On Windows, open a new command terminal and run the javac -version command. This command must be recognized as a valid command; otherwise, check your configuration details again.

How it works...

The installed JDK will be the core language interpreter of Spring 5.0 projects, whether or not they are deployed to a Tomcat 9.x application server through Maven or Gradle. To read more about JDK 1.8, the reference http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html will provide you with some information about its highlights and will explain why it is popular nowadays in functional and reactive programming. More detailed concepts on functional programming will be discussed in Chapter 6, Functional Programming.

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

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