Skip to Main Content
Java EE 8 Development with Eclipse
book

Java EE 8 Development with Eclipse

by Ram Kulkarni
June 2018
Intermediate to advanced content levelIntermediate to advanced
596 pages
12h 39m
English
Packt Publishing
Content preview from Java EE 8 Development with Eclipse

Dependency injection in Spring

Because DI is at the core of the Spring Framework, let's spend some time understanding how it works in Spring. We will create a standalone application for this purpose. Create a simple Maven project. Add the following dependency for the Spring Framework:

    <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-context</artifactId> 
      <version>5.0.5.RELEASE</version> 
    </dependency> 

Replace the preceding version number with the latest version of Spring. Classes managed by the DI container of Spring are called beans or components. You can either declare beans in an XML file or you can annotate the class. We will use annotations in this chapter. However, even though we use annotations, we need to specify ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java EE 7: The Big Picture

Java EE 7: The Big Picture

Dr. Danny Coward
Professional Java EE Design Patterns

Professional Java EE Design Patterns

Murat Yener, Alex Theedom

Publisher Resources

ISBN: 9781788833776Supplemental Content