SlideShare a Scribd company logo
Introduction to STRUTS
Presenter: Jyoti Kar, Mindfire Solutions
Presenter: Jyoti Kar, Mindfire Solutions
AGENDA
* Introduction to MVC
* What is MVC1 and MVC2
* Struts 1 (Use of MVC)
* Struts 2 Introduction
* Difference between Struts 1 and Struts 2
Presenter: Jyoti Kar, Mindfire Solutions
UNDERSTANDING MVC
* MVC is an architectural pattern.
* Separates application logic and presentation.
* Loose coupling of components.
* Adds flexibility to the development process.
* Components – Model , View and Controller.
Presenter: Jyoti Kar, Mindfire Solutions
ARCHITECTURE
Presenter: Jyoti Kar, Mindfire Solutions
MVC 1 ARCHITECTURE
* MVC1 associates the presentation logic with the
business logic.
* In MVC 1, controller and model,both are JSP.
* Doesn't support re usability of application
components.
Presenter: Jyoti Kar, Mindfire Solutions
MVC 2 ARCHITECTURE
* MVC 2 isolates the presentation logic from business
logic.
* In MVC 2 controller is servlet and model is java class.
* Supports re usability of application components.
Presenter: Jyoti Kar, Mindfire Solutions
WHAT IS STRUTS
* Struts is an open source Web application framework
developed as Apache Jakarta project.
* Model-View-Controller (MVC) framework.
* 3 Major Components in Struts
– Servlet controller (Controller)
– JSP or any other presentation technology (View)
– Application Business Logic in the form of
whatever suits the application (Model)
* Struts is focused on Controller
– Struts is Model and View independent.
Presenter: Jyoti Kar, Mindfire Solutions
STRUTS ARCHITECTURE
Presenter: Jyoti Kar, Mindfire Solutions
CONTROLLER COMPONENTS IN STRUTS
* ActionServlet (Provided by Struts)
– Process user requests.
– Determine what the user is trying to achieve
according to the request.
– Pull data from the model (if necessary) to be
given to the appropriate view, and select the
proper view to respond to the user.
* RequestProcessor (Provided by Struts)
– Determine the ActionMapping associated with
this path.
– Instantiate the ActionForm associated with the
mapping and place it into the appropriate scope.
Presenter: Jyoti Kar, Mindfire Solutions
– Populate the ActionForm associated with this
request, if any.
– Perform validation (if requested) on the
ActionForm associated with this request (if any) .
– Instantiate an instance of the Action class
specified by the ActionMapping and calls the
execute() method.
– Finally, the process method of the
RequestProcessor takes the ActionForward
returned by your Action class, and uses to select
the next resource (if any).
Presenter:Jyoti Kar, Mindfire Solutions
* Action
– Extend org.jakarta.struts.action.Action
– Process client request by calling other objects
(BusinessLogic beans) inside its execute()
Method.
– Returns an ActionForward object that identifies
where control should be forwarded.
Public ActionForward execute(ActionMapping mapping,
ActionForm form,HttpServletRequest Request,
HttpServletResponse response)throws Exception;
Presenter: Jyoti Kar, Mindfire Solutions
* Action Form Bean
– Extends Action Form class defined by Struts.
– Contains only property getter and property setter
methods for each field-no business logic.
– Provides standard validation mechanism.
* Action Mapping
– Action mapping is specified in struts-config.xml .
– Struts framework creates ActionMapping object
and passes it to Action object.
Presenter: Jyoti Kar, Mindfire Solutions
* struts-config.xml contains three important
elements used to describe actions:
– <form-beans>contains FormBean definitions
Including name and type (classname).
– <action-mapping> contains action definitions
Use an <action> element for each action defined.
– <global-forwards>contains your global forward
definitions.
Presenter: Jyoti Kar, Mindfire Solutions
<struts-config>
<!-- ========== Form Bean Definitions ================= -->
<form-beans>
<form-bean name = "submitForm"
type = "com.mindfire.SubmitForm"/>
</form-beans>
<!-- ========== Global Forward Definitions ============ -->
<global-forwards type="org.apache.struts.action.ActionForward">
<forward name="logon"
path="/logon.jsp" />
</global-forwards>
Presenter: Jyoti Kar, Mindfire Solutions
<!-- ========== Action Mapping Definitions ============ -->
<action-mappings>
<action
path = "/submit"
type="com.mindfire.SubmitAction"
name="submitForm"
input="/submit.jsp"
scope="request"
validate="true">
<forward name="success" path="/submit.jsp"/>
<forward name="failure" path="/failure.jsp"/>
</action>
</action-mappings>
</struts-config>
Presenter: Jyoti Kar, Mindfire Solutions
MODEL COMPONENTS IN STRUTS
* ActionForm Bean
– ActionFormBean can be regarded as a Model
component.
* SystemState Bean
– This is a conceptual term: Struts does not
provide any programming API.
* BusinessLogic Bean
– This is a conceptual term: Struts does not
provide any programming API.
Presenter: Jyoti Kar, Mindfire Solutions
VIEW COMPONENTS IN STRUTS
* JSP files
* Tag libraries
* Resource files for internationalization.
Presenter: Jyoti Kar, Mindfire Solutions
VIEW COMPONENTS IN STRUTS
* JSP files
* Tag libraries
* Resource files for internationalization.
Presenter: Jyoti Kar, Mindfire Solutions
STRUTS2 ARCHITECTURE
Presenter: Jyoti Kar, Mindfire Solutions
REQUEST LIFE CYCLE
* User sends a request to the server.
* The FilterDispatcher looks at the request and
then determines the appropriate Action.
* Configured interceptors functionality applies
such as validation, file upload etc.
* Selected action is executed to perform the
requested operation.
* Finally the result is prepared by the view and
returns the result to the user.
Presenter: Jyoti Kar, Mindfire Solutions
DIFFERENCE BETWEEN STRUTS1 & STRUTS2
* In Struts2 Action class is POJO.
* Struts2 actions are instantiated for each request.
* Struts2 Actions are independent of Servlet API .
* Action form is not required rather action
properties are used in Struts 2.
* Struts2 supports annotations.
Presenter: Jyoti Kar, Mindfire Solutions
Question and
Answer
Presenter: Jyoti Kar, Mindfire Solutions
Thank you

More Related Content

What's hot

MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )Ahmed Emad
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepGuo Albert
 
Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming  Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming WebStackAcademy
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right wayThibaud Desodt
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC ArchitecturePrem Sanil
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginningAnis Ahmad
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design PatternRothana Choun
 
Angular 8
Angular 8 Angular 8
Angular 8 Sunil OS
 
Design Pattern - Factory Method Pattern
Design Pattern - Factory Method PatternDesign Pattern - Factory Method Pattern
Design Pattern - Factory Method PatternMudasir Qazi
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jspJafar Nesargi
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaEdureka!
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutesSimon Willison
 

What's hot (20)

Java J2EE
Java J2EEJava J2EE
Java J2EE
 
MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )
 
Ajax and Jquery
Ajax and JqueryAjax and Jquery
Ajax and Jquery
 
SQLite database in android
SQLite database in androidSQLite database in android
SQLite database in android
 
Android Networking
Android NetworkingAndroid Networking
Android Networking
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 
Reactjs
Reactjs Reactjs
Reactjs
 
Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming  Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming
 
Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design Pattern
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Design Pattern - Factory Method Pattern
Design Pattern - Factory Method PatternDesign Pattern - Factory Method Pattern
Design Pattern - Factory Method Pattern
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | Edureka
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 

Viewers also liked

Introduction to Struts 1.3
Introduction to Struts 1.3Introduction to Struts 1.3
Introduction to Struts 1.3Ilio Catallo
 
Administración de riesgos en un proyecto software
Administración de riesgos en un proyecto softwareAdministración de riesgos en un proyecto software
Administración de riesgos en un proyecto softwareAnna Vega
 
PLANEACION DE PROYECTOS DE SOFTWARE
PLANEACION DE PROYECTOS DE SOFTWAREPLANEACION DE PROYECTOS DE SOFTWARE
PLANEACION DE PROYECTOS DE SOFTWAREAlberto Zurita
 
Planeacion y elaboración de proyectos de software
Planeacion y elaboración de proyectos de softwarePlaneacion y elaboración de proyectos de software
Planeacion y elaboración de proyectos de softwareTtomas Carvajal
 
Planificación de proyectos de software
Planificación de proyectos de softwarePlanificación de proyectos de software
Planificación de proyectos de softwarehrubenleiva21
 
Proyecto de software
Proyecto de softwareProyecto de software
Proyecto de softwaremonik1002
 

Viewers also liked (9)

Struts presentation
Struts presentationStruts presentation
Struts presentation
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
 
Introduction to Struts 1.3
Introduction to Struts 1.3Introduction to Struts 1.3
Introduction to Struts 1.3
 
Administración de riesgos en un proyecto software
Administración de riesgos en un proyecto softwareAdministración de riesgos en un proyecto software
Administración de riesgos en un proyecto software
 
JSP
JSPJSP
JSP
 
PLANEACION DE PROYECTOS DE SOFTWARE
PLANEACION DE PROYECTOS DE SOFTWAREPLANEACION DE PROYECTOS DE SOFTWARE
PLANEACION DE PROYECTOS DE SOFTWARE
 
Planeacion y elaboración de proyectos de software
Planeacion y elaboración de proyectos de softwarePlaneacion y elaboración de proyectos de software
Planeacion y elaboración de proyectos de software
 
Planificación de proyectos de software
Planificación de proyectos de softwarePlanificación de proyectos de software
Planificación de proyectos de software
 
Proyecto de software
Proyecto de softwareProyecto de software
Proyecto de software
 

Similar to Introduction to struts

important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questionssurendray
 
We sport architecture_implementation
We sport architecture_implementationWe sport architecture_implementation
We sport architecture_implementationaurelianaur
 
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02Rati Manandhar
 
Strut2-Spring-Hibernate
Strut2-Spring-HibernateStrut2-Spring-Hibernate
Strut2-Spring-HibernateJay Shah
 
Project Description Of Incident Management System Developed by PRS (CRIS) , N...
Project Description Of Incident Management System Developed by PRS (CRIS) , N...Project Description Of Incident Management System Developed by PRS (CRIS) , N...
Project Description Of Incident Management System Developed by PRS (CRIS) , N...varunsunny21
 
Struts tutorial
Struts tutorialStruts tutorial
Struts tutorialOPENLANE
 
SenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay Platonov
SenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay PlatonovSenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay Platonov
SenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay PlatonovSencha
 
JavaScripters Event Oct 22, 2016 · 2:00 PM: Common Mistakes made by Angular D...
JavaScripters Event Oct 22, 2016 · 2:00 PM: Common Mistakes made by Angular D...JavaScripters Event Oct 22, 2016 · 2:00 PM: Common Mistakes made by Angular D...
JavaScripters Event Oct 22, 2016 · 2:00 PM: Common Mistakes made by Angular D...JavaScripters Community
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Matt Raible
 
Struts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsStruts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsJavaEE Trainers
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet Sagar Nakul
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet Sagar Nakul
 
Introduction to Struts
Introduction to StrutsIntroduction to Struts
Introduction to Strutselliando dias
 

Similar to Introduction to struts (20)

important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
 
Struts Intro
Struts IntroStruts Intro
Struts Intro
 
We sport architecture_implementation
We sport architecture_implementationWe sport architecture_implementation
We sport architecture_implementation
 
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
Stepbystepguideforbuidlingsimplestrutsapp 090702025438-phpapp02
 
Strut2-Spring-Hibernate
Strut2-Spring-HibernateStrut2-Spring-Hibernate
Strut2-Spring-Hibernate
 
Project Description Of Incident Management System Developed by PRS (CRIS) , N...
Project Description Of Incident Management System Developed by PRS (CRIS) , N...Project Description Of Incident Management System Developed by PRS (CRIS) , N...
Project Description Of Incident Management System Developed by PRS (CRIS) , N...
 
Struts tutorial
Struts tutorialStruts tutorial
Struts tutorial
 
Angular Seminar-js
Angular Seminar-jsAngular Seminar-js
Angular Seminar-js
 
Juzu framework
Juzu frameworkJuzu framework
Juzu framework
 
SenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay Platonov
SenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay PlatonovSenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay Platonov
SenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay Platonov
 
JavaScripters Event Oct 22, 2016 · 2:00 PM: Common Mistakes made by Angular D...
JavaScripters Event Oct 22, 2016 · 2:00 PM: Common Mistakes made by Angular D...JavaScripters Event Oct 22, 2016 · 2:00 PM: Common Mistakes made by Angular D...
JavaScripters Event Oct 22, 2016 · 2:00 PM: Common Mistakes made by Angular D...
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
 
Struts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsStruts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web Applications
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
Introduction to Struts
Introduction to StrutsIntroduction to Struts
Introduction to Struts
 
Jsf intro
Jsf introJsf intro
Jsf intro
 
AngularJs-training
AngularJs-trainingAngularJs-training
AngularJs-training
 
Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)
 
Struts 1
Struts 1Struts 1
Struts 1
 

More from Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 

Recently uploaded

IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfalexjohnson7307
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Product School
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 

Recently uploaded (20)

IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 

Introduction to struts

  • 1. Introduction to STRUTS Presenter: Jyoti Kar, Mindfire Solutions
  • 2. Presenter: Jyoti Kar, Mindfire Solutions AGENDA * Introduction to MVC * What is MVC1 and MVC2 * Struts 1 (Use of MVC) * Struts 2 Introduction * Difference between Struts 1 and Struts 2
  • 3. Presenter: Jyoti Kar, Mindfire Solutions UNDERSTANDING MVC * MVC is an architectural pattern. * Separates application logic and presentation. * Loose coupling of components. * Adds flexibility to the development process. * Components – Model , View and Controller.
  • 4. Presenter: Jyoti Kar, Mindfire Solutions ARCHITECTURE
  • 5. Presenter: Jyoti Kar, Mindfire Solutions MVC 1 ARCHITECTURE * MVC1 associates the presentation logic with the business logic. * In MVC 1, controller and model,both are JSP. * Doesn't support re usability of application components.
  • 6. Presenter: Jyoti Kar, Mindfire Solutions MVC 2 ARCHITECTURE * MVC 2 isolates the presentation logic from business logic. * In MVC 2 controller is servlet and model is java class. * Supports re usability of application components.
  • 7. Presenter: Jyoti Kar, Mindfire Solutions WHAT IS STRUTS * Struts is an open source Web application framework developed as Apache Jakarta project. * Model-View-Controller (MVC) framework. * 3 Major Components in Struts – Servlet controller (Controller) – JSP or any other presentation technology (View) – Application Business Logic in the form of whatever suits the application (Model) * Struts is focused on Controller – Struts is Model and View independent.
  • 8. Presenter: Jyoti Kar, Mindfire Solutions STRUTS ARCHITECTURE
  • 9. Presenter: Jyoti Kar, Mindfire Solutions CONTROLLER COMPONENTS IN STRUTS * ActionServlet (Provided by Struts) – Process user requests. – Determine what the user is trying to achieve according to the request. – Pull data from the model (if necessary) to be given to the appropriate view, and select the proper view to respond to the user. * RequestProcessor (Provided by Struts) – Determine the ActionMapping associated with this path. – Instantiate the ActionForm associated with the mapping and place it into the appropriate scope.
  • 10. Presenter: Jyoti Kar, Mindfire Solutions – Populate the ActionForm associated with this request, if any. – Perform validation (if requested) on the ActionForm associated with this request (if any) . – Instantiate an instance of the Action class specified by the ActionMapping and calls the execute() method. – Finally, the process method of the RequestProcessor takes the ActionForward returned by your Action class, and uses to select the next resource (if any).
  • 11. Presenter:Jyoti Kar, Mindfire Solutions * Action – Extend org.jakarta.struts.action.Action – Process client request by calling other objects (BusinessLogic beans) inside its execute() Method. – Returns an ActionForward object that identifies where control should be forwarded. Public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest Request, HttpServletResponse response)throws Exception;
  • 12. Presenter: Jyoti Kar, Mindfire Solutions * Action Form Bean – Extends Action Form class defined by Struts. – Contains only property getter and property setter methods for each field-no business logic. – Provides standard validation mechanism. * Action Mapping – Action mapping is specified in struts-config.xml . – Struts framework creates ActionMapping object and passes it to Action object.
  • 13. Presenter: Jyoti Kar, Mindfire Solutions * struts-config.xml contains three important elements used to describe actions: – <form-beans>contains FormBean definitions Including name and type (classname). – <action-mapping> contains action definitions Use an <action> element for each action defined. – <global-forwards>contains your global forward definitions.
  • 14. Presenter: Jyoti Kar, Mindfire Solutions <struts-config> <!-- ========== Form Bean Definitions ================= --> <form-beans> <form-bean name = "submitForm" type = "com.mindfire.SubmitForm"/> </form-beans> <!-- ========== Global Forward Definitions ============ --> <global-forwards type="org.apache.struts.action.ActionForward"> <forward name="logon" path="/logon.jsp" /> </global-forwards>
  • 15. Presenter: Jyoti Kar, Mindfire Solutions <!-- ========== Action Mapping Definitions ============ --> <action-mappings> <action path = "/submit" type="com.mindfire.SubmitAction" name="submitForm" input="/submit.jsp" scope="request" validate="true"> <forward name="success" path="/submit.jsp"/> <forward name="failure" path="/failure.jsp"/> </action> </action-mappings> </struts-config>
  • 16. Presenter: Jyoti Kar, Mindfire Solutions MODEL COMPONENTS IN STRUTS * ActionForm Bean – ActionFormBean can be regarded as a Model component. * SystemState Bean – This is a conceptual term: Struts does not provide any programming API. * BusinessLogic Bean – This is a conceptual term: Struts does not provide any programming API.
  • 17. Presenter: Jyoti Kar, Mindfire Solutions VIEW COMPONENTS IN STRUTS * JSP files * Tag libraries * Resource files for internationalization.
  • 18. Presenter: Jyoti Kar, Mindfire Solutions VIEW COMPONENTS IN STRUTS * JSP files * Tag libraries * Resource files for internationalization.
  • 19. Presenter: Jyoti Kar, Mindfire Solutions STRUTS2 ARCHITECTURE
  • 20. Presenter: Jyoti Kar, Mindfire Solutions REQUEST LIFE CYCLE * User sends a request to the server. * The FilterDispatcher looks at the request and then determines the appropriate Action. * Configured interceptors functionality applies such as validation, file upload etc. * Selected action is executed to perform the requested operation. * Finally the result is prepared by the view and returns the result to the user.
  • 21. Presenter: Jyoti Kar, Mindfire Solutions DIFFERENCE BETWEEN STRUTS1 & STRUTS2 * In Struts2 Action class is POJO. * Struts2 actions are instantiated for each request. * Struts2 Actions are independent of Servlet API . * Action form is not required rather action properties are used in Struts 2. * Struts2 supports annotations.
  • 22. Presenter: Jyoti Kar, Mindfire Solutions Question and Answer
  • 23. Presenter: Jyoti Kar, Mindfire Solutions Thank you