SlideShare ist ein Scribd-Unternehmen logo
1 von 23
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

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Java servlets
Java servletsJava servlets
Java servlets
 
android activity
android activityandroid activity
android activity
 
Bridge pattern
Bridge patternBridge pattern
Bridge pattern
 
Activity lifecycle
Activity lifecycleActivity lifecycle
Activity lifecycle
 
Fragment
Fragment Fragment
Fragment
 
Shared preferences
Shared preferencesShared preferences
Shared preferences
 
Struts Basics
Struts BasicsStruts Basics
Struts Basics
 
Composite pattern
Composite patternComposite pattern
Composite pattern
 
Java applets
Java appletsJava applets
Java applets
 
Event Handling in Java
Event Handling in JavaEvent Handling in Java
Event Handling in Java
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Applets in java
Applets in javaApplets in java
Applets in java
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
 
Composite design pattern
Composite design patternComposite design pattern
Composite design pattern
 
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
 
Abstraction in java
Abstraction in javaAbstraction in java
Abstraction in java
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
 
Applets
AppletsApplets
Applets
 

Andere mochten auch

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
 

Andere mochten auch (10)

Struts presentation
Struts presentationStruts presentation
Struts presentation
 
Struts framework
Struts frameworkStruts framework
Struts framework
 
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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Kürzlich hochgeladen (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

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