SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
Struts & Spring Framework
Issues
Anshu Gaur
(1103014007)
Struts
 Struts is an open-source web application
framework from apache for developing Java EE
applications.
 It was originally created by Craig McClanahan and
donated to the Apache Foundation in May, 2000.
Formerly located under the Apache Jakarta
Project and known as Jakarta Struts, it became a
top-level Apache project in 2005.
 It uses and extends the Java Servlet API to
encourage developers to adopt a model-view-
controller (MVC) architecture.
 Struts offers a set of tag libraries to support the
faster development of the different layers of the
web application
Struts Framework
 The Struts Framework is a standard for developing
well-architected Web applications. It has the following
features:
 Open source
 Based on the Model-View-Controller (MVC) design
paradigm, distinctly separating all three levels:
◦ Model: application
◦ View: presentation of data (JSP, HTML)
◦ Controller: routing of the application flow
 Implements the JSP Model 2 Architecture
 Stores application routing information and request
mapping in a single core file, struts-config.xml
M-V-C
◦ Model: application state(Represent Data Layer)
◦ View: presentation of data (JSP, HTML)(represent the data
processed by the model component)
◦ Controller: routing of the application flow(Responsible for
interaction b/w model & controller ·
 All incoming requests are intercepted by the Struts servlet
controller.
 The Struts Configuration file struts-config.xml is used by the
controller to determine the routing of the flow.
 This flows consists of an alternation between two
transitions:
 FromView to Action: A user clicks on a link or submits a
form on an HTML or JSP page.The controller receives the
request, looks up the mapping for this request, and forwards
it to an action.The action in turn calls a Model layer
(Business layer) service or function.
 From Action toView: After the call to an underlying
function or service returns to the action class, the action
forwards to a resource in theView layer and a page is
displayed in a web browser.
Spring Framework
 Spring is a light weight and open source
framework created by Rod Johnson in 2003.
 Spring is a complete and a modular framework, i.e. ,
spring framework can be used for all layer
implementations for a real time application.
 Spring can be used for the development of
particular layer of a real time application unlike
struts [ only for front end related ] and hibernate [
only for database related ], but with spring we can
develop all layers.
 Spring framework is said to be a non-invasive means it doesn’t
force a programmer to extend or implement their class from any
predefined class or interface given by Spring API, in struts we used
to extend Action Class right that’s why struts is said to be invasive.
 Spring is light weight framework because of its POJO (plain old Java
objects)model; when it comes to size and transparency.The basic
version of spring framework is around 2MB.
 Spring Framework made J2EE application development little easier,
by introducing POJO model
 Spring having this much of demand because of the following 3
reasons….
1. Simplicity
2. Testability
3. Loose Coupling
Spring Framework Architecture
 Spring is modular, allowing you to pick
and choose which modules are applicable
to you, without having to bring in the rest.
The Spring Framework provides about 20
modules which can be used based on an
application requirement.
 Actually in spring 1.x, the framework has
divided into 7 well defined modules. But
in 2.x framework is divided into 6
modules only..
◦ Spring Core Module
◦ Spring Context [ J2EE ]
◦ Spring DAO Module [ Spring JDBC ]
◦ Spring ORM module
◦ Spring AOP [ Aspect Oriented Programming ]
◦ SpringWEB-MVC Module
 Spring Core Module is the base for all
modules, and very important.
Spring Framework
 Core modules are :
Aspect oriented programming(AOP)
Object relational mapping(ORM)
Data access object(DAO)
J2EE
Web-MVC
 Aspect-oriented programming: enables
implementing cross-cutting concerns.
 Object relational mapping:The ORM module provides
integration layers for popular object-relational mapping APIs,
including JPA, JDO, Hibernate,.
 Data access object: working with relational database
management systems on the Java platform
using JDBC and object-relational mapping tools and
with NoSQL databases.
 Web-MVC: The Web module provides basic web-oriented
integration features such as multipart file-upload functionality
and the initialization of the IoC(Inversion of contrl) container
using servlet listeners and a web-oriented application
context.
The Web-Servlet module contains Spring's model-view-
controller (MVC) implementation for web applications.
Difference b/w struts & spring framework
Struts Spring
Struts is a sophisticated framework
offering the easy 2 develop, structured
view/presentation layer of the MVC
applications.
Springs is a Lightweight Inversion of
Control and Aspect Oriented
Container Framework. It is just not a
framework to integrate / plug in at the
presentation layer.
it provides a framework to integrate
OR mapping, JDBC etc.,
Struts can be used as the presentation
tier in Spring.
Struts is mainly a presentation layer
framework, like redirecting to a
particular page ,doing client side
validations etc which otherwise very
tedious using jsp and servlets.
Spring is a complete J2EE framework
having seven independent layers which
can be used all together or few layers
integrated with some other
framework. Spring provides declarative
transaction management and AOP.
One layer of spring is for presentation
purpose like struts but for only
presentation layer, struts is better than
spring
Struts 2 has AJAX theme. Spring is not.
Struts is developed with a Front
Controller and dispatcher pattern.
Where in all the requests go to the
ActionServlet thereby routed to the
module specific Request Processor
which then loads the associated Form
Beans, perform validations and then
handovers the control to the
appropriate Action class with the help
of the action mapping specified in
Struts-config.xml file.
Spring does not route the request in a
specific way like this, rather it allows
to you to design in your own way
however in allowing to exploit the
power of framework, it allows you to
use the Aspect Oriented Programming
and Inversion of Control in a great
way with great deal of declarative
programming with the XML.
Commons framework can be
integrated to leverage the validation in
spring framework too.
Struts 2 tags are style sheet-driven,
making it easier to develop consistent
pages.
Spring is not.
Thank you

Weitere ähnliche Inhalte

Was ist angesagt?

JSF 2.3: Integration with Front-End Frameworks
JSF 2.3: Integration with Front-End FrameworksJSF 2.3: Integration with Front-End Frameworks
JSF 2.3: Integration with Front-End FrameworksIan Hlavats
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applicationselliando dias
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVCJohn Lewis
 
Spring MVC Architecture Tutorial
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture TutorialJava Success Point
 
Step by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts ApplicationStep by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts Applicationelliando dias
 
Spring Basics
Spring BasicsSpring Basics
Spring BasicsEmprovise
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenlissa cidhi
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkRaveendra R
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCJohn Lewis
 

Was ist angesagt? (20)

Struts
StrutsStruts
Struts
 
Struts presentation
Struts presentationStruts presentation
Struts presentation
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Struts course material
Struts course materialStruts course material
Struts course material
 
JSF 2.3: Integration with Front-End Frameworks
JSF 2.3: Integration with Front-End FrameworksJSF 2.3: Integration with Front-End Frameworks
JSF 2.3: Integration with Front-End Frameworks
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applications
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
 
Struts framework
Struts frameworkStruts framework
Struts framework
 
141060753008 3715301
141060753008 3715301141060753008 3715301
141060753008 3715301
 
Spring MVC Architecture Tutorial
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture Tutorial
 
Struts notes
Struts notesStruts notes
Struts notes
 
Step by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts ApplicationStep by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts Application
 
Spring Basics
Spring BasicsSpring Basics
Spring Basics
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for women
 
Spring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 IntegrationSpring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 Integration
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVC
 

Andere mochten auch

JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015Naz Ish
 
Spring By Example One Day Workshop
Spring By Example One Day WorkshopSpring By Example One Day Workshop
Spring By Example One Day Workshopspringbyexample
 
A PRESENTATION ON STRUTS & HIBERNATE
A PRESENTATION ON STRUTS & HIBERNATEA PRESENTATION ON STRUTS & HIBERNATE
A PRESENTATION ON STRUTS & HIBERNATETushar Choudhary
 
Hibernate architecture
Hibernate architectureHibernate architecture
Hibernate architectureAnurag
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworksMukesh Kumar
 
Introduction to Java Enterprise Edition
Introduction to Java Enterprise EditionIntroduction to Java Enterprise Edition
Introduction to Java Enterprise EditionAbdalla Mahmoud
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkMohit Belwal
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewBrett Meyer
 
Creating modern java web applications based on struts2 and angularjs
Creating modern java web applications based on struts2 and angularjsCreating modern java web applications based on struts2 and angularjs
Creating modern java web applications based on struts2 and angularjsJohannes Geppert
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 
Lecture 8 Enterprise Java Beans (EJB)
Lecture 8  Enterprise Java Beans (EJB)Lecture 8  Enterprise Java Beans (EJB)
Lecture 8 Enterprise Java Beans (EJB)Fahad Golra
 

Andere mochten auch (20)

Struts Overview
Struts OverviewStruts Overview
Struts Overview
 
JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015
 
Struts2
Struts2Struts2
Struts2
 
Struts2
Struts2Struts2
Struts2
 
Spring By Example One Day Workshop
Spring By Example One Day WorkshopSpring By Example One Day Workshop
Spring By Example One Day Workshop
 
Struts2
Struts2Struts2
Struts2
 
Struts2
Struts2Struts2
Struts2
 
Struts
StrutsStruts
Struts
 
A PRESENTATION ON STRUTS & HIBERNATE
A PRESENTATION ON STRUTS & HIBERNATEA PRESENTATION ON STRUTS & HIBERNATE
A PRESENTATION ON STRUTS & HIBERNATE
 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3
 
Hibernate architecture
Hibernate architectureHibernate architecture
Hibernate architecture
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
 
Introduction to Java Enterprise Edition
Introduction to Java Enterprise EditionIntroduction to Java Enterprise Edition
Introduction to Java Enterprise Edition
 
Java Enterprise Edition
Java Enterprise EditionJava Enterprise Edition
Java Enterprise Edition
 
Why do I hate Hibernate?
Why do I hate Hibernate?Why do I hate Hibernate?
Why do I hate Hibernate?
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate Framework
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate Overview
 
Creating modern java web applications based on struts2 and angularjs
Creating modern java web applications based on struts2 and angularjsCreating modern java web applications based on struts2 and angularjs
Creating modern java web applications based on struts2 and angularjs
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
Lecture 8 Enterprise Java Beans (EJB)
Lecture 8  Enterprise Java Beans (EJB)Lecture 8  Enterprise Java Beans (EJB)
Lecture 8 Enterprise Java Beans (EJB)
 

Ähnlich wie Struts & spring framework issues

Comparison of spring and other frameworks.!
Comparison of spring and other frameworks.!Comparison of spring and other frameworks.!
Comparison of spring and other frameworks.!Sibu Stephen
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework tola99
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorialvinayiqbusiness
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts frameworks4al_com
 
Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2javatrainingonline
 
Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsVirtual Nuggets
 
Spring Framework
Spring FrameworkSpring Framework
Spring Frameworknomykk
 
Modern Java Web Development
Modern Java Web DevelopmentModern Java Web Development
Modern Java Web Developmentzenyk
 
spring framework ppt by Rohit malav
spring framework ppt by Rohit malavspring framework ppt by Rohit malav
spring framework ppt by Rohit malavRohit malav
 
How Spring Framework Really Works?
How Spring Framework Really Works?How Spring Framework Really Works?
How Spring Framework Really Works?NexSoftsys
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overviewskill-guru
 

Ähnlich wie Struts & spring framework issues (20)

Comparison of spring and other frameworks.!
Comparison of spring and other frameworks.!Comparison of spring and other frameworks.!
Comparison of spring and other frameworks.!
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
Spring notes
Spring notesSpring notes
Spring notes
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
 
MVC
MVCMVC
MVC
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 
Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2
 
Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggets
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Month 2 report
Month 2 reportMonth 2 report
Month 2 report
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Modern Java Web Development
Modern Java Web DevelopmentModern Java Web Development
Modern Java Web Development
 
spring framework ppt by Rohit malav
spring framework ppt by Rohit malavspring framework ppt by Rohit malav
spring framework ppt by Rohit malav
 
How Spring Framework Really Works?
How Spring Framework Really Works?How Spring Framework Really Works?
How Spring Framework Really Works?
 
Spring mvc 2.0
Spring mvc 2.0Spring mvc 2.0
Spring mvc 2.0
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overview
 
Spring
SpringSpring
Spring
 
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
 

Kürzlich hochgeladen

The relationship between iot and communication technology
The relationship between iot and communication technologyThe relationship between iot and communication technology
The relationship between iot and communication technologyabdulkadirmukarram03
 
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docx
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docxSUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docx
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docxNaveenVerma126
 
Carbohydrates principles of biochemistry
Carbohydrates principles of biochemistryCarbohydrates principles of biochemistry
Carbohydrates principles of biochemistryKomakeTature
 
Gender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 ProjectGender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 Projectreemakb03
 
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxUNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxrealme6igamerr
 
Power System electrical and electronics .pptx
Power System electrical and electronics .pptxPower System electrical and electronics .pptx
Power System electrical and electronics .pptxMUKULKUMAR210
 
me3493 manufacturing technology unit 1 Part A
me3493 manufacturing technology unit 1 Part Ame3493 manufacturing technology unit 1 Part A
me3493 manufacturing technology unit 1 Part Akarthi keyan
 
Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Bahzad5
 
cloud computing notes for anna university syllabus
cloud computing notes for anna university syllabuscloud computing notes for anna university syllabus
cloud computing notes for anna university syllabusViolet Violet
 
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdfSummer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdfNaveenVerma126
 
How to Write a Good Scientific Paper.pdf
How to Write a Good Scientific Paper.pdfHow to Write a Good Scientific Paper.pdf
How to Write a Good Scientific Paper.pdfRedhwan Qasem Shaddad
 
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratoryدليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide LaboratoryBahzad5
 
IT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptxIT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptxSAJITHABANUS
 
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS Bahzad5
 
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfRenewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfodunowoeminence2019
 
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdfsdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdfJulia Kaye
 
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...soginsider
 

Kürzlich hochgeladen (20)

The relationship between iot and communication technology
The relationship between iot and communication technologyThe relationship between iot and communication technology
The relationship between iot and communication technology
 
計劃趕得上變化
計劃趕得上變化計劃趕得上變化
計劃趕得上變化
 
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docx
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docxSUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docx
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docx
 
Présentation IIRB 2024 Chloe Dufrane.pdf
Présentation IIRB 2024 Chloe Dufrane.pdfPrésentation IIRB 2024 Chloe Dufrane.pdf
Présentation IIRB 2024 Chloe Dufrane.pdf
 
Carbohydrates principles of biochemistry
Carbohydrates principles of biochemistryCarbohydrates principles of biochemistry
Carbohydrates principles of biochemistry
 
Gender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 ProjectGender Bias in Engineer, Honors 203 Project
Gender Bias in Engineer, Honors 203 Project
 
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxUNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
 
Power System electrical and electronics .pptx
Power System electrical and electronics .pptxPower System electrical and electronics .pptx
Power System electrical and electronics .pptx
 
me3493 manufacturing technology unit 1 Part A
me3493 manufacturing technology unit 1 Part Ame3493 manufacturing technology unit 1 Part A
me3493 manufacturing technology unit 1 Part A
 
Lecture 4 .pdf
Lecture 4                              .pdfLecture 4                              .pdf
Lecture 4 .pdf
 
Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)
 
cloud computing notes for anna university syllabus
cloud computing notes for anna university syllabuscloud computing notes for anna university syllabus
cloud computing notes for anna university syllabus
 
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdfSummer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
 
How to Write a Good Scientific Paper.pdf
How to Write a Good Scientific Paper.pdfHow to Write a Good Scientific Paper.pdf
How to Write a Good Scientific Paper.pdf
 
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratoryدليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
 
IT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptxIT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptx
 
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
 
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfRenewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
 
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdfsdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
 
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
 

Struts & spring framework issues

  • 1. Struts & Spring Framework Issues Anshu Gaur (1103014007)
  • 2. Struts  Struts is an open-source web application framework from apache for developing Java EE applications.  It was originally created by Craig McClanahan and donated to the Apache Foundation in May, 2000. Formerly located under the Apache Jakarta Project and known as Jakarta Struts, it became a top-level Apache project in 2005.  It uses and extends the Java Servlet API to encourage developers to adopt a model-view- controller (MVC) architecture.  Struts offers a set of tag libraries to support the faster development of the different layers of the web application
  • 3. Struts Framework  The Struts Framework is a standard for developing well-architected Web applications. It has the following features:  Open source  Based on the Model-View-Controller (MVC) design paradigm, distinctly separating all three levels: ◦ Model: application ◦ View: presentation of data (JSP, HTML) ◦ Controller: routing of the application flow  Implements the JSP Model 2 Architecture  Stores application routing information and request mapping in a single core file, struts-config.xml
  • 4. M-V-C ◦ Model: application state(Represent Data Layer) ◦ View: presentation of data (JSP, HTML)(represent the data processed by the model component) ◦ Controller: routing of the application flow(Responsible for interaction b/w model & controller ·
  • 5.  All incoming requests are intercepted by the Struts servlet controller.  The Struts Configuration file struts-config.xml is used by the controller to determine the routing of the flow.  This flows consists of an alternation between two transitions:  FromView to Action: A user clicks on a link or submits a form on an HTML or JSP page.The controller receives the request, looks up the mapping for this request, and forwards it to an action.The action in turn calls a Model layer (Business layer) service or function.  From Action toView: After the call to an underlying function or service returns to the action class, the action forwards to a resource in theView layer and a page is displayed in a web browser.
  • 6. Spring Framework  Spring is a light weight and open source framework created by Rod Johnson in 2003.  Spring is a complete and a modular framework, i.e. , spring framework can be used for all layer implementations for a real time application.  Spring can be used for the development of particular layer of a real time application unlike struts [ only for front end related ] and hibernate [ only for database related ], but with spring we can develop all layers.
  • 7.  Spring framework is said to be a non-invasive means it doesn’t force a programmer to extend or implement their class from any predefined class or interface given by Spring API, in struts we used to extend Action Class right that’s why struts is said to be invasive.  Spring is light weight framework because of its POJO (plain old Java objects)model; when it comes to size and transparency.The basic version of spring framework is around 2MB.  Spring Framework made J2EE application development little easier, by introducing POJO model  Spring having this much of demand because of the following 3 reasons…. 1. Simplicity 2. Testability 3. Loose Coupling
  • 8. Spring Framework Architecture  Spring is modular, allowing you to pick and choose which modules are applicable to you, without having to bring in the rest. The Spring Framework provides about 20 modules which can be used based on an application requirement.
  • 9.  Actually in spring 1.x, the framework has divided into 7 well defined modules. But in 2.x framework is divided into 6 modules only.. ◦ Spring Core Module ◦ Spring Context [ J2EE ] ◦ Spring DAO Module [ Spring JDBC ] ◦ Spring ORM module ◦ Spring AOP [ Aspect Oriented Programming ] ◦ SpringWEB-MVC Module  Spring Core Module is the base for all modules, and very important.
  • 10. Spring Framework  Core modules are : Aspect oriented programming(AOP) Object relational mapping(ORM) Data access object(DAO) J2EE Web-MVC
  • 11.  Aspect-oriented programming: enables implementing cross-cutting concerns.  Object relational mapping:The ORM module provides integration layers for popular object-relational mapping APIs, including JPA, JDO, Hibernate,.  Data access object: working with relational database management systems on the Java platform using JDBC and object-relational mapping tools and with NoSQL databases.  Web-MVC: The Web module provides basic web-oriented integration features such as multipart file-upload functionality and the initialization of the IoC(Inversion of contrl) container using servlet listeners and a web-oriented application context. The Web-Servlet module contains Spring's model-view- controller (MVC) implementation for web applications.
  • 12. Difference b/w struts & spring framework Struts Spring Struts is a sophisticated framework offering the easy 2 develop, structured view/presentation layer of the MVC applications. Springs is a Lightweight Inversion of Control and Aspect Oriented Container Framework. It is just not a framework to integrate / plug in at the presentation layer. it provides a framework to integrate OR mapping, JDBC etc., Struts can be used as the presentation tier in Spring. Struts is mainly a presentation layer framework, like redirecting to a particular page ,doing client side validations etc which otherwise very tedious using jsp and servlets. Spring is a complete J2EE framework having seven independent layers which can be used all together or few layers integrated with some other framework. Spring provides declarative transaction management and AOP. One layer of spring is for presentation purpose like struts but for only presentation layer, struts is better than spring
  • 13. Struts 2 has AJAX theme. Spring is not. Struts is developed with a Front Controller and dispatcher pattern. Where in all the requests go to the ActionServlet thereby routed to the module specific Request Processor which then loads the associated Form Beans, perform validations and then handovers the control to the appropriate Action class with the help of the action mapping specified in Struts-config.xml file. Spring does not route the request in a specific way like this, rather it allows to you to design in your own way however in allowing to exploit the power of framework, it allows you to use the Aspect Oriented Programming and Inversion of Control in a great way with great deal of declarative programming with the XML. Commons framework can be integrated to leverage the validation in spring framework too. Struts 2 tags are style sheet-driven, making it easier to develop consistent pages. Spring is not.