-
Book Overview & Buying
-
Table Of Contents
Spring 5.0 Cookbook
By :
Another option for implementing the Spring 5.0 container is through the use of SpringJavaConfig. This is a technique that uses pure Java classes in configuring the framework's container. This solution eliminates the use of bulky and tedious XML metadata and also provides a type-safe and refactoring-free approach in configuring entities or collections of objects into the container. This recipe will showcase how to create the container using JavaConfig in a web.xml-less approach.
Create another Maven project using the methodology in Chapter 1, Getting Started with Spring, and name the project ch02-xml. This STS Eclipse project will be using a Java class approach including its deployment descriptor.
Let us now apply the JavaConfig specification in building the Spring context definition:
pom.xml of ch02-jc and add <properties>, <dependencies>, and ...