www.javatpoint.com Open in urlscan Pro
2a06:98c1:3121::a  Public Scan

URL: https://www.javatpoint.com/ioc-container
Submission Tags: falconsandbox
Submission: On May 22 via api from US — Scanned from DE

Form analysis 2 forms found in the DOM

<form class="gsc-search-box gsc-search-box-tools" accept-charset="utf-8">
  <table cellspacing="0" cellpadding="0" class="gsc-search-box">
    <tbody>
      <tr>
        <td class="gsc-input">
          <div class="gsc-input-box" id="gsc-iw-id1">
            <table cellspacing="0" cellpadding="0" id="gs_id50" class="gstl_50 gsc-input" style="width: 100%; padding: 0px;">
              <tbody>
                <tr>
                  <td id="gs_tti50" class="gsib_a"><input autocomplete="off" type="text" size="10" class="gsc-input" name="search" title="search" id="gsc-i-id1" dir="ltr" spellcheck="false"
                      style="width: 100%; padding: 0px; border: none; margin: 0px; height: auto; outline: none;"></td>
                  <td class="gsib_b">
                    <div class="gsst_b" id="gs_st50" dir="ltr"><a class="gsst_a" href="javascript:void(0)" title="Clear search box" role="button" style="display: none;"><span class="gscb_a" id="gs_cb50" aria-hidden="true">×</span></a></div>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </td>
        <td class="gsc-search-button"><button class="gsc-search-button gsc-search-button-v2"><svg width="13" height="13" viewBox="0 0 13 13">
              <title>search</title>
              <path
                d="m4.8495 7.8226c0.82666 0 1.5262-0.29146 2.0985-0.87438 0.57232-0.58292 0.86378-1.2877 0.87438-2.1144 0.010599-0.82666-0.28086-1.5262-0.87438-2.0985-0.59352-0.57232-1.293-0.86378-2.0985-0.87438-0.8055-0.010599-1.5103 0.28086-2.1144 0.87438-0.60414 0.59352-0.8956 1.293-0.87438 2.0985 0.021197 0.8055 0.31266 1.5103 0.87438 2.1144 0.56172 0.60414 1.2665 0.8956 2.1144 0.87438zm4.4695 0.2115 3.681 3.6819-1.259 1.284-3.6817-3.7 0.0019784-0.69479-0.090043-0.098846c-0.87973 0.76087-1.92 1.1413-3.1207 1.1413-1.3553 0-2.5025-0.46363-3.4417-1.3909s-1.4088-2.0686-1.4088-3.4239c0-1.3553 0.4696-2.4966 1.4088-3.4239 0.9392-0.92727 2.0864-1.3969 3.4417-1.4088 1.3553-0.011889 2.4906 0.45771 3.406 1.4088 0.9154 0.95107 1.379 2.0924 1.3909 3.4239 0 1.2126-0.38043 2.2588-1.1413 3.1385l0.098834 0.090049z">
              </path>
            </svg></button></td>
        <td class="gsc-clear-button">
          <div class="gsc-clear-button" title="clear results">&nbsp;</div>
        </td>
      </tr>
    </tbody>
  </table>
</form>

<form class="gsc-search-box gsc-search-box-tools" accept-charset="utf-8">
  <table cellspacing="0" cellpadding="0" class="gsc-search-box">
    <tbody>
      <tr>
        <td class="gsc-input">
          <div class="gsc-input-box" id="gsc-iw-id2">
            <table cellspacing="0" cellpadding="0" id="gs_id51" class="gstl_51 gsc-input" style="width: 100%; padding: 0px;">
              <tbody>
                <tr>
                  <td id="gs_tti51" class="gsib_a"><input autocomplete="off" type="text" size="10" class="gsc-input" name="search" title="search" id="gsc-i-id2" dir="ltr" spellcheck="false"
                      style="width: 100%; padding: 0px; border: none; margin: 0px; height: auto; outline: none;"></td>
                  <td class="gsib_b">
                    <div class="gsst_b" id="gs_st51" dir="ltr"><a class="gsst_a" href="javascript:void(0)" title="Clear search box" role="button" style="display: none;"><span class="gscb_a" id="gs_cb51" aria-hidden="true">×</span></a></div>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </td>
        <td class="gsc-search-button"><button class="gsc-search-button gsc-search-button-v2"><svg width="13" height="13" viewBox="0 0 13 13">
              <title>search</title>
              <path
                d="m4.8495 7.8226c0.82666 0 1.5262-0.29146 2.0985-0.87438 0.57232-0.58292 0.86378-1.2877 0.87438-2.1144 0.010599-0.82666-0.28086-1.5262-0.87438-2.0985-0.59352-0.57232-1.293-0.86378-2.0985-0.87438-0.8055-0.010599-1.5103 0.28086-2.1144 0.87438-0.60414 0.59352-0.8956 1.293-0.87438 2.0985 0.021197 0.8055 0.31266 1.5103 0.87438 2.1144 0.56172 0.60414 1.2665 0.8956 2.1144 0.87438zm4.4695 0.2115 3.681 3.6819-1.259 1.284-3.6817-3.7 0.0019784-0.69479-0.090043-0.098846c-0.87973 0.76087-1.92 1.1413-3.1207 1.1413-1.3553 0-2.5025-0.46363-3.4417-1.3909s-1.4088-2.0686-1.4088-3.4239c0-1.3553 0.4696-2.4966 1.4088-3.4239 0.9392-0.92727 2.0864-1.3969 3.4417-1.4088 1.3553-0.011889 2.4906 0.45771 3.406 1.4088 0.9154 0.95107 1.379 2.0924 1.3909 3.4239 0 1.2126-0.38043 2.2588-1.1413 3.1385l0.098834 0.090049z">
              </path>
            </svg></button></td>
        <td class="gsc-clear-button">
          <div class="gsc-clear-button" title="clear results">&nbsp;</div>
        </td>
      </tr>
    </tbody>
  </table>
</form>

Text Content

⇧ SCROLL TO TOP
×

search
 

Custom Search

Sort by:
Relevance

Relevance
Date




×

search
 

Custom Search

Sort by:
Relevance

Relevance
Date



 * Home
 * Core Java
 * Servlet
 * JSP
 * Struts2
 * Mail API
 * Hibernate
 * Spring
 * Android
 * Design Pattern
 * Quiz
 * Projects
 * Interview Q
 * Comment
 * Forum





SPRING TUTORIAL

What is Spring Spring Modules Spring Application


SPRING IN IDE

Spring in Myeclipse Spring in Eclipse


DEPENDENCY INJECTION

IOC container Dependency Injection Constructor Injection CI Dependent Object CI
with collection CI with collection 2 CI with Map CI with Map2 CI Inheriting Bean
Setter Injection SI Dependent Object SI with Collection SI with Collection 2 SI
with Map SI with Map 2 CI vs SI Autowiring Factory Method


SPRING AOP

AOP Concepts Spring1.2 AOP DTD SP AspectJ Annotation SP AspectJ XML


SPRING JDBCTEMPLATE

JdbcTemplate Example PreparedStatement ResultSetExtractor RowMapper
NamedParameter SimpleJdbcTemplate


SPRING ORM

Spring with ORM Spring with Hibernate Spring with JPA


SPEL

SpEL Examples Operators in SpEL variable in SpEL


SPRING MVC

MVC Introduction Multiple View Page Multiple Controller Model Interface
RequestParam Annotation


MVC FORM TAG LIBRARY

Form Tag Library Form Text Field Form Radio Button Form Check Box Form Drop-Down
List


MVC APPLICATIONS

MVC CRUD Example MVC Pagination Example File Upload Example


SPRING MVC VALIDATION

Spring MVC Validation Regular Expression Validation Number Validation Custom
Validation


MVC TILES

Spring MVC Tiles


SPRING REMOTING

Remoting with Spring Spring with RMI Http Invoker Hessian Burlap Spring with JMS


SPRING OXM

Spring with JAXB Spring with Xstream Spring with Castor


SPRING JAVA MAIL

Spring Java Mail


SPRING WEB

Spring with Struts2 Login Example


SPRING SECURITY TUTORIAL

Sp Security Tutorial Sp Security Introduction Sp Security Features Security
Project Modules Sp Security XML Example Sp Security Java Example Sp Security
Login Logout Sp Security Custom Login Form-Based Authentication Sp Security
Remember Me Security at Method Level Sp Security Tag Library


SPRING + ANGULAR

CRUD Example File Upload Example Login & Logout Example Search Field Example


MISC

Best Spring Books


SPRING BOOT

Spring Boot (15+)


SPRING INTERVIEW

Interview Questions


SPRING QUIZ

Spring Quiz


next → ← prev


IOC CONTAINER

 1. IoC Container
 2. Using BeanFactory
 3. Using ApplicationContext

The IoC container is responsible to instantiate, configure and assemble the
objects. The IoC container gets informations from the XML file and works
accordingly. The main tasks performed by IoC container are:

 * to instantiate the application class
 * to configure the object
 * to assemble the dependencies between the objects

There are two types of IoC containers. They are:

 1. BeanFactory
 2. ApplicationContext


DIFFERENCE BETWEEN BEANFACTORY AND THE APPLICATIONCONTEXT

The org.springframework.beans.factory.BeanFactory and the
org.springframework.context.ApplicationContext interfaces acts as the IoC
container. The ApplicationContext interface is built on top of the BeanFactory
interface. It adds some extra functionality than BeanFactory such as simple
integration with Spring's AOP, message resource handling (for I18N), event
propagation, application layer specific context (e.g. WebApplicationContext) for
web application. So it is better to use ApplicationContext than BeanFactory.


USING BEANFACTORY

The XmlBeanFactory is the implementation class for the BeanFactory interface. To
use the BeanFactory, we need to create the instance of XmlBeanFactory class as
given below:





 1. Resource resource=new ClassPathResource("applicationContext.xml");  
 2. BeanFactory factory=new XmlBeanFactory(resource);  

Resource resource=new ClassPathResource("applicationContext.xml"); BeanFactory
factory=new XmlBeanFactory(resource);

The constructor of XmlBeanFactory class receives the Resource object so we need
to pass the resource object to create the object of BeanFactory.

--------------------------------------------------------------------------------

USING APPLICATIONCONTEXT

The ClassPathXmlApplicationContext class is the implementation class of
ApplicationContext interface. We need to instantiate the
ClassPathXmlApplicationContext class to use the ApplicationContext as given
below:

 1. ApplicationContext context =   
 2.     new ClassPathXmlApplicationContext("applicationContext.xml");  

ApplicationContext context = new
ClassPathXmlApplicationContext("applicationContext.xml");

The constructor of ClassPathXmlApplicationContext class receives string, so we
can pass the name of the xml file to create the instance of ApplicationContext.

download the example to use ApplicationContext
Next TopicDependency Injection In Spring


← prev next →




--------------------------------------------------------------------------------

For Videos Join Our Youtube Channel: Join Now

--------------------------------------------------------------------------------


FEEDBACK

 * Send your Feedback to feedback@javatpoint.com

--------------------------------------------------------------------------------


HELP OTHERS, PLEASE SHARE

--------------------------------------------------------------------------------


LEARN LATEST TUTORIALS

Splunk

SPSS

Swagger

Transact-SQL

Tumblr

ReactJS

Regex

Reinforcement Learning

R Programming

RxJS

React Native

Python Design Patterns

Python Pillow

Python Turtle

Keras

--------------------------------------------------------------------------------


PREPARATION

Aptitude

Reasoning

Verbal Ability

Interview Questions

Company Questions

--------------------------------------------------------------------------------


TRENDING TECHNOLOGIES

Artificial Intelligence

AWS

Selenium

Cloud Computing

Hadoop

ReactJS

Data Science

Angular 7

Blockchain

Git

Machine Learning

DevOps



--------------------------------------------------------------------------------


B.TECH / MCA

DBMS

Data Structures

DAA

Operating System

Computer Network

Compiler Design

Computer Organization

Discrete Mathematics

Ethical Hacking

Computer Graphics

Software Engineering

Web Technology

Cyber Security

Automata

C Programming

C++

Java

.Net

Python

Programs

Control System

Data Mining

Data Warehouse















JAVATPOINT SERVICES

JavaTpoint offers too many high quality services. Mail us on hr@javatpoint.com,
to get more information about given services.

 * Website Designing
 * Website Development
 * Java Development
 * PHP Development
 * WordPress
 * Graphic Designing
 * Logo
 * Digital Marketing
 * On Page and Off Page SEO
 * PPC
 * Content Development
 * Corporate Training
 * Classroom and Online Training
 * Data Entry




TRAINING FOR COLLEGE CAMPUS

JavaTpoint offers college campus training on Core Java, Advance Java, .Net,
Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at
hr@javatpoint.com.
Duration: 1 week to 2 week


Like/Subscribe us for latest updates or newsletter


LEARN TUTORIALS

Learn JavaLearn Data StructuresLearn C ProgrammingLearn C++ TutorialLearn C#
TutorialLearn PHP TutorialLearn HTML TutorialLearn JavaScript TutorialLearn
jQuery TutorialLearn Spring Tutorial


OUR WEBSITES

Javatpoint.comHindi100.comLyricsia.comQuoteperson.comJobandplacement.com


OUR SERVICES

Website Development

Android Development

Website Designing

Digital Marketing

Summer Training

Industrial Training

College Campus Training


CONTACT

Address: G-13, 2nd Floor, Sec-3

Noida, UP, 201301, India

Contact No: 0120-4256464, 9990449935

Contact Us Subscribe Us Privacy PolicySitemap
About Me

© Copyright 2011-2021 www.javatpoint.com. All rights reserved. Developed by
JavaTpoint.