SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados (20)

Introduction to Struts 1.3
Introduction to Struts 1.3Introduction to Struts 1.3
Introduction to Struts 1.3
 
Testing API platform with Behat BDD tests
Testing API platform with Behat BDD testsTesting API platform with Behat BDD tests
Testing API platform with Behat BDD tests
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Hibernate
HibernateHibernate
Hibernate
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
User journey
User journeyUser journey
User journey
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
Struts
StrutsStruts
Struts
 
Builder design pattern
Builder design patternBuilder design pattern
Builder design pattern
 
Introduction à React
Introduction à ReactIntroduction à React
Introduction à React
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
 
Android Accessibility
Android AccessibilityAndroid Accessibility
Android Accessibility
 
Criação de Ambientes de Realidade Virtual usando A-Frame
Criação de Ambientes  de Realidade Virtual  usando A-FrameCriação de Ambientes  de Realidade Virtual  usando A-Frame
Criação de Ambientes de Realidade Virtual usando A-Frame
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
React Native
React NativeReact Native
React Native
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
Introduction to java 8 stream api
Introduction to java 8 stream apiIntroduction to java 8 stream api
Introduction to java 8 stream api
 

Destaque

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
 

Destaque (9)

Struts presentation
Struts presentationStruts presentation
Struts presentation
 
Struts introduction
Struts introductionStruts introduction
Struts introduction
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
 
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
 

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Último

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Último (20)

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

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