SlideShare a Scribd company logo
Introduction to
Spring
framework
SpringMehul
Jariwala
1
• Framework.
• Spring History.
• Key Features of Spring
Framework.
• Spring Architecture.
• Spring Files.
• Steps For Creating Spring Projects.
Overvie
w
2
Framework
 Frameworks are large prewritten code to which
you add your own code to solve a problem in a
specific domain.
 You make use of a framework by calling its
methods,inheritance,and supplying “call-backs”
listeners.
 Example Java’s Swing and AWT classes.They
have a huge amount of code to manage the
user interface and there is inversion of control.
3
Framework
• Software frameworks may include support
programs, compilers , code libraries , tool sets ,
API , Function, Producer , Datafile.
4
Spring
 Spring is the most popular application
development framework for enterprise Java™.
 Millions of developers use Spring to create
high performing, easily testable, reusable code
without any lock-in.
 Open source Java platform since 2003.
 Reduces code and speeds up development.
 Current Version is 4.0 5
Spring layer
Presentation layer – An MVC framework that is most
similar to Struts but is more powerful and easy to use.
Business layer – Lightweight IOC container and AOP
support (including built in aspects)
Persistence layer – DAO template support for popular
ORMs and JDBC
6
Spring layer
Presentation Logic Layer
Business Logic Layer
Data Access Layer
PHP,JSP,HTML
Data Base
App Logic
Data StorageBrowser View
Procedures
7
Spring History
8
Goals
 Make J2EE easier to use
 Make the common tasks easier
 Promote good programming practice.
 You can focus on the domain problems.
9
 Lightweight: Spring Framework is lightweight
with respect to size and transparency.
 Container: Spring Framework creates and
manages the life cycle and configuration of
application objects.
 Spring supports All types of application
development: We can develop any type of
applications using spring, e.g. Core java, web
Application, Distributed application, Enterprise
application.
Spring Features
10
Spring Architecture
 The Spring framework is a layered architecture
which consists of several modules.
 All modules are built on the top of its core
container.
 It's modular architecture enables integration
with other frameworks without much difficulties
11
Spring Architecture
12
Spring Architecture
The Core Module: This module contains
the Bean Factory, an implementation of Factory
Pattern which creates the bean as per the
configurations provided by the developer in an
XML file.
Core Module
The IOC Container.
13
Spring Architecture
 The AOP Module: AOP is a useful technique
that enables adding executable blocks to the
source code without explicitly changing it.
 AOP to avoid re-implementation of some
common behaviour in multiple classes.
AOP
Spring AOP
AspectJ integration
14
Spring Architecture
 The DAO Module:- (Data Access Object)
standardizes the data access work using
JDBC, Hibernate or JDO.
 This provides an abstraction layer to the low
level task of creating a connection, releasing it
etc.
DAO
Spring JDBC
Transaction
Management
15
Spring Architecture
 The ORM Module:- Spring doesn’t provides its
own ORM implementation but offers
integrations with popular Object Relational
mapping tools like Hibernate, iBATIS SQL
Maps, Oracle TopLink and JPA etc.
ORM
Hibernate
JPA,JDO,OJB
16
Spring Architecture
 The JEE Module:- It also provides support for
JMX, JCA, EJB and JMS etc.
 JCA (Java EE Connection API).
 EJB (Enterprise JavaBeans).
 JMS (Java Message Service).
JEE
EJB
JMS
17
Spring Architecture
 The Web Module:- Spring comes with MVC
framework which eases the task of developing
web applications.
 It also integrates well with the most popular
MVC frameworks like Struts, Tapestry, JSF,
Wicket etc.
18
New about Spring
19
Spring Project File
 Application Context.xml
The Application Context is Spring's advanced
container. Similar to Bean Factory, it can load
bean definitions.
This container is defined
by org.springframework.context.ApplicationCont
e xtinterface.
20
Spring Project File
 The most commonly used Application
Context implementations.
1. FileSystemXmlApplicationContext − Here you need
to provide the full path of the XML bean configuration
file.
2. ClassPathXmlApplicationContext − Here you do not
need To provide the full path of the XML file but you
need to set CLASSPATH.
3. WebXmlApplicationContext − This container loads
the XML file with definitions of all beans from within a21
Spring Project File
 Dispatcher-servlet.xml
The Spring Web model-view-controller (MVC)
framework is designed around a Dispatcher
Servlet that handles all the HTTP requests and
responses.
22
Spring Project File
 Web.xml
The /WEB-INF/web.xml file is used to define
how to deploy the web module to a Servlet
container like JBoss, Tomcat, Glassfish or any
other servlet container.
Basically web.xml tell container all servlets in
the web application with <servlet> element , then
tell container when to use which servlet by the url
mapping with <servlet-mapping> element.
23
Steps For Creating Project
 Step 1:- Creating Projects and Select Java
Web Application.
24
Steps For Creating Project
 Step 2:- Write a Name of Java Application
Projects And Click Finish.
25
Steps For Creating Project
 Step 3:- Select Spring Web MVC
Frameworks.
26
Steps For Creating Project
 Step 4:- Structure Of Spring MVC.
27
Reference
 https://www.roseindia.net/spring/architecture-of-
spring.shtml
 http://www.java4s.com/spring-mvc/spring-mvc-
execution-flow-diagram-spring-mvc-3-2-flow/
 https://dzone.com/articles/spring-framework-architecture
 https://www.javacodegeeks.com/2013/02/introduction-to-
javaee-concepts.html
 https://www.javatpoint.com/example-of-spring-
application-in-eclipse
 https://www.tutorialspoint.com/spring/spring_web_mvc_f
ramework.htm
 https://stackoverflow.com/questions/4545968/loading-
application-context-xml 28
Thanks You.
29

More Related Content

What's hot (20)

Spring Framework
Spring Framework
nomykk
 
Introduction to spring boot
Introduction to spring boot
Santosh Kumar Kar
 
Spring Boot
Spring Boot
HongSeong Jeon
 
Spring Boot
Spring Boot
Jaran Flaath
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoC
Funnelll
 
Spring framework
Spring framework
Rajkumar Singh
 
Xke spring boot
Xke spring boot
sourabh aggarwal
 
Spring Boot Tutorial
Spring Boot Tutorial
Naphachara Rattanawilai
 
Introduction to Spring Framework
Introduction to Spring Framework
Serhat Can
 
Spring boot
Spring boot
sdeeg
 
Spring boot
Spring boot
Pradeep Shanmugam
 
Introduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
 
Spring Framework - Core
Spring Framework - Core
Dzmitry Naskou
 
Spring boot
Spring boot
Gyanendra Yadav
 
Spring Boot
Spring Boot
Jiayun Zhou
 
Spring boot introduction
Spring boot introduction
Rasheed Waraich
 
Spring Boot in Action
Spring Boot in Action
Alex Movila
 
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
shaunthomas999
 
Spring: Overview do framework mais popular para desenvolvimento em Java
Spring: Overview do framework mais popular para desenvolvimento em Java
Mariana de Azevedo Santos
 
Spring boot jpa
Spring boot jpa
Hamid Ghorbani
 
Spring Framework
Spring Framework
nomykk
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoC
Funnelll
 
Introduction to Spring Framework
Introduction to Spring Framework
Serhat Can
 
Spring boot
Spring boot
sdeeg
 
Spring Framework - Core
Spring Framework - Core
Dzmitry Naskou
 
Spring boot introduction
Spring boot introduction
Rasheed Waraich
 
Spring Boot in Action
Spring Boot in Action
Alex Movila
 
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
shaunthomas999
 
Spring: Overview do framework mais popular para desenvolvimento em Java
Spring: Overview do framework mais popular para desenvolvimento em Java
Mariana de Azevedo Santos
 

Similar to Java Spring Framework (20)

spring framework ppt by Rohit malav
spring framework ppt by Rohit malav
Rohit malav
 
Spring Framework Rohit
Spring Framework Rohit
Rohit Prabhakar
 
Spring - a framework written by developers
Spring - a framework written by developers
MarcioSoaresPereira1
 
Getting Started with Spring Framework
Getting Started with Spring Framework
Edureka!
 
Spring framework-tutorial
Spring framework-tutorial
vinayiqbusiness
 
Struts & spring framework issues
Struts & spring framework issues
Prashant Seth
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworks
Mukesh Kumar
 
Spring tutorials
Spring tutorials
TIB Academy
 
Spring framework
Spring framework
Kani Selvam
 
Spring Mvc,Java, Spring
Spring Mvc,Java, Spring
ifnu bima
 
Introduction to Spring Framework
Introduction to Spring Framework
Dineesha Suraweera
 
Skillwise-Spring framework 1
Skillwise-Spring framework 1
Skillwise Group
 
Integration of Struts & Spring & Hibernate for Enterprise Applications
Integration of Struts & Spring & Hibernate for Enterprise Applications
IJMER
 
Spring framework Introduction
Spring framework Introduction
Anuj Singh Rajput
 
01 spring-intro
01 spring-intro
hossein helali
 
Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggets
Virtual Nuggets
 
Spring notes
Spring notes
Rajeev Uppala
 
Spring presentecion isil
Spring presentecion isil
Willy Aguirre
 
Spring presentecion isil
Spring presentecion isil
Willy Aguirre
 
Spring Framework -I
Spring Framework -I
People Strategists
 
spring framework ppt by Rohit malav
spring framework ppt by Rohit malav
Rohit malav
 
Spring - a framework written by developers
Spring - a framework written by developers
MarcioSoaresPereira1
 
Getting Started with Spring Framework
Getting Started with Spring Framework
Edureka!
 
Spring framework-tutorial
Spring framework-tutorial
vinayiqbusiness
 
Struts & spring framework issues
Struts & spring framework issues
Prashant Seth
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworks
Mukesh Kumar
 
Spring tutorials
Spring tutorials
TIB Academy
 
Spring framework
Spring framework
Kani Selvam
 
Spring Mvc,Java, Spring
Spring Mvc,Java, Spring
ifnu bima
 
Introduction to Spring Framework
Introduction to Spring Framework
Dineesha Suraweera
 
Skillwise-Spring framework 1
Skillwise-Spring framework 1
Skillwise Group
 
Integration of Struts & Spring & Hibernate for Enterprise Applications
Integration of Struts & Spring & Hibernate for Enterprise Applications
IJMER
 
Spring framework Introduction
Spring framework Introduction
Anuj Singh Rajput
 
Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggets
Virtual Nuggets
 
Spring presentecion isil
Spring presentecion isil
Willy Aguirre
 
Spring presentecion isil
Spring presentecion isil
Willy Aguirre
 
Ad

Recently uploaded (20)

How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18
Celine George
 
la storia dell'Inghilterra, letteratura inglese
la storia dell'Inghilterra, letteratura inglese
LetiziaLucente
 
Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...
EduSkills OECD
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
How to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time Off
Celine George
 
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx
Arshad Shaikh
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
National Information Standards Organization (NISO)
 
What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
ChalaKelbessa
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Unit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptx
bobby205207
 
How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18
Celine George
 
la storia dell'Inghilterra, letteratura inglese
la storia dell'Inghilterra, letteratura inglese
LetiziaLucente
 
Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...
EduSkills OECD
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
How to Create Time Off Request in Odoo 18 Time Off
How to Create Time Off Request in Odoo 18 Time Off
Celine George
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx
Arshad Shaikh
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
ChalaKelbessa
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Unit 3 Poster Sketches with annotations.pptx
Unit 3 Poster Sketches with annotations.pptx
bobby205207
 
Ad

Java Spring Framework

  • 2. • Framework. • Spring History. • Key Features of Spring Framework. • Spring Architecture. • Spring Files. • Steps For Creating Spring Projects. Overvie w 2
  • 3. Framework  Frameworks are large prewritten code to which you add your own code to solve a problem in a specific domain.  You make use of a framework by calling its methods,inheritance,and supplying “call-backs” listeners.  Example Java’s Swing and AWT classes.They have a huge amount of code to manage the user interface and there is inversion of control. 3
  • 4. Framework • Software frameworks may include support programs, compilers , code libraries , tool sets , API , Function, Producer , Datafile. 4
  • 5. Spring  Spring is the most popular application development framework for enterprise Java™.  Millions of developers use Spring to create high performing, easily testable, reusable code without any lock-in.  Open source Java platform since 2003.  Reduces code and speeds up development.  Current Version is 4.0 5
  • 6. Spring layer Presentation layer – An MVC framework that is most similar to Struts but is more powerful and easy to use. Business layer – Lightweight IOC container and AOP support (including built in aspects) Persistence layer – DAO template support for popular ORMs and JDBC 6
  • 7. Spring layer Presentation Logic Layer Business Logic Layer Data Access Layer PHP,JSP,HTML Data Base App Logic Data StorageBrowser View Procedures 7
  • 9. Goals  Make J2EE easier to use  Make the common tasks easier  Promote good programming practice.  You can focus on the domain problems. 9
  • 10.  Lightweight: Spring Framework is lightweight with respect to size and transparency.  Container: Spring Framework creates and manages the life cycle and configuration of application objects.  Spring supports All types of application development: We can develop any type of applications using spring, e.g. Core java, web Application, Distributed application, Enterprise application. Spring Features 10
  • 11. Spring Architecture  The Spring framework is a layered architecture which consists of several modules.  All modules are built on the top of its core container.  It's modular architecture enables integration with other frameworks without much difficulties 11
  • 13. Spring Architecture The Core Module: This module contains the Bean Factory, an implementation of Factory Pattern which creates the bean as per the configurations provided by the developer in an XML file. Core Module The IOC Container. 13
  • 14. Spring Architecture  The AOP Module: AOP is a useful technique that enables adding executable blocks to the source code without explicitly changing it.  AOP to avoid re-implementation of some common behaviour in multiple classes. AOP Spring AOP AspectJ integration 14
  • 15. Spring Architecture  The DAO Module:- (Data Access Object) standardizes the data access work using JDBC, Hibernate or JDO.  This provides an abstraction layer to the low level task of creating a connection, releasing it etc. DAO Spring JDBC Transaction Management 15
  • 16. Spring Architecture  The ORM Module:- Spring doesn’t provides its own ORM implementation but offers integrations with popular Object Relational mapping tools like Hibernate, iBATIS SQL Maps, Oracle TopLink and JPA etc. ORM Hibernate JPA,JDO,OJB 16
  • 17. Spring Architecture  The JEE Module:- It also provides support for JMX, JCA, EJB and JMS etc.  JCA (Java EE Connection API).  EJB (Enterprise JavaBeans).  JMS (Java Message Service). JEE EJB JMS 17
  • 18. Spring Architecture  The Web Module:- Spring comes with MVC framework which eases the task of developing web applications.  It also integrates well with the most popular MVC frameworks like Struts, Tapestry, JSF, Wicket etc. 18
  • 20. Spring Project File  Application Context.xml The Application Context is Spring's advanced container. Similar to Bean Factory, it can load bean definitions. This container is defined by org.springframework.context.ApplicationCont e xtinterface. 20
  • 21. Spring Project File  The most commonly used Application Context implementations. 1. FileSystemXmlApplicationContext − Here you need to provide the full path of the XML bean configuration file. 2. ClassPathXmlApplicationContext − Here you do not need To provide the full path of the XML file but you need to set CLASSPATH. 3. WebXmlApplicationContext − This container loads the XML file with definitions of all beans from within a21
  • 22. Spring Project File  Dispatcher-servlet.xml The Spring Web model-view-controller (MVC) framework is designed around a Dispatcher Servlet that handles all the HTTP requests and responses. 22
  • 23. Spring Project File  Web.xml The /WEB-INF/web.xml file is used to define how to deploy the web module to a Servlet container like JBoss, Tomcat, Glassfish or any other servlet container. Basically web.xml tell container all servlets in the web application with <servlet> element , then tell container when to use which servlet by the url mapping with <servlet-mapping> element. 23
  • 24. Steps For Creating Project  Step 1:- Creating Projects and Select Java Web Application. 24
  • 25. Steps For Creating Project  Step 2:- Write a Name of Java Application Projects And Click Finish. 25
  • 26. Steps For Creating Project  Step 3:- Select Spring Web MVC Frameworks. 26
  • 27. Steps For Creating Project  Step 4:- Structure Of Spring MVC. 27
  • 28. Reference  https://www.roseindia.net/spring/architecture-of- spring.shtml  http://www.java4s.com/spring-mvc/spring-mvc- execution-flow-diagram-spring-mvc-3-2-flow/  https://dzone.com/articles/spring-framework-architecture  https://www.javacodegeeks.com/2013/02/introduction-to- javaee-concepts.html  https://www.javatpoint.com/example-of-spring- application-in-eclipse  https://www.tutorialspoint.com/spring/spring_web_mvc_f ramework.htm  https://stackoverflow.com/questions/4545968/loading- application-context-xml 28