SlideShare a Scribd company logo
1 of 23
How does struts work? Mohammad Seyed Alavi [email_address]
[object Object],[object Object],[object Object],[object Object],Document Map
User’s scenario ,[object Object]
Name: Submit Name: Submit Name: Submit Mohammad Mohammad Fill Form's Field Trigger the action Mohammad
Name: Submit Incorrect name Name: Submit Incorrect name Hamed Correct the name & trigger the action Mohammad Welcome ……………… Hamed
How does struts work? ,[object Object],[object Object]
Primitives ObjectName Attr=value Attr=value Attr=value ,[object Object],object maker ClassName ObjectName ,[object Object]
Primitives (cont.) ObjectName Attr=value Class.Method(args) Return value ,[object Object],ObjectName Attr=value Class.Method(args) ,[object Object]
[object Object]
Name: Submit Name: Submit Name: Submit Mohammad Mohammad Fill Form's Field Trigger the action name =“  ” Mohammad 1 <%@ taglib prefix=&quot;s&quot;  uri=&quot;/struts-tags&quot;%> <s:textfield  name=” name ”... entrance.jsp Find the name’s field name 2 field=“  ”
<s:form action =  “  ” . . . <action name = “  ” class =  “  ” method =  “  ”> . . . Find the action name  from “entrance.jsp” file Find the action class and method from &quot;struts.xml&quot; 1.name=“Mohammad” 2.action class=“  “ 3.action method=“  “ 1 3 5 2.action=“  “ 4 submit Entrance signIn submit Entrance signIn entrance.jsp struts.xml submit 1.field=“name” 2
Value Stack An object of action class will be created if there  is not any of that in  value stack object maker Entrance entrance entrance name =  “ Mohammad” There wasn't any object so make new one entrance_o Name =  “ Mohammad” entrance Entrance.setName(“Mohammad”) entrance name =  “ Mohammad” Entrance.setName(“Mohammad”) void call the setter name=“Mohammad” action class=“Entrance“ 3.action method=“signIn“ 1 3 5 2.action=“submit“ 4 3 1 2 field=“name” 2 3
Call the action method Return the return value entrance name =  “ Mohammad” Entrance.signIn() entrance name =  “ Mohammad” Entrance.signIn() “ No” name=“Mohammad” action class=“Entrance“ action method=“signIn“ 1 3 5 2.action=“submit“ 4 3 5 return value=  6 “ No” field=“name” 2
entrance name =  “ Mohammad” Value Stack Push the object on top of value stack name=“Mohammad” action class=“Entrance“ action method=“signIn“ 1 3 5 2.action=“submit“ 4 return value=“No” 6 field=“name” 2
<action name=“submit”> <result name = “ No ”> main.jsp?msg = “Incorrect name” </result> . . . </action> Find the target page  corresponding to return  value from “struts.xml” Name: Submit Go to the result page Incorrect name name=“Mohammad” action class=“Entrance“ action method=“signIn“ 1 2 3 action=“submit“ 4 return value=“No” 5 4 5 struts.xml field=“  ” 6 <%@ taglib prefix=&quot;s&quot;  uri=&quot;/struts-tags&quot;%> Name: <s:textfield  name=” name ”... entrance.jsp Find the name’s field name
Value Stack Find the object from the top of value stack to initialize the result page (first object that has “name” property)  entrance_o Name =  “ Mohammad” entrance entrance name =  “ Mohammad” Entrance.getName() entrance name =  “ Mohammad” Entrance.getName() “ Mohammad” Name: Submit Incorrect name Mohammad Name: Submit Incorrect name Hamed Correct the name & trigger the action name=“  ” action class=“Entrance“ action method=“signIn“ 5 2 3 action=“submit“ 4 Hamed 2 1 field=“name” 1 Retrieve name property from action object
1.name=“Hamed” 1 field=“  ” 2 <%@ taglib prefix=&quot;s&quot;  uri=&quot;/struts-tags&quot;%> Name: <s:textfield  name=” name ”... entrance.jsp name Find the name’s field
<s:form action =  “  ” . . . <action name = “  ” class =  “  ” method =  “  ”> . . . Find the action name  from “entrance.jsp” file Find the action class and method from &quot;struts.xml&quot; 1.name=“Hamed” 2.action class=“  “ 3.action method=“  “ 1 3 5 2.action=“  “ 4 submit Entrance signIn submit Entrance signIn entrance.jsp struts.xml submit field=“name” 2
Value Stack New Request So, new value stack object maker Entrance entrance entrance name =  “ Hamed” There wasn't any object so make new one entrance_o Name =  “ Mohammad” entrance Entrance.setName(“Hamed”) entrance name =  “ Hamed” Entrance.setName(“Hamed”) void call the setter name=“Hamed” action class=“Entrance“ 3.action method=“signIn“ 1 3 5 2.action=“submit“ 4 3 1 2 field=“name” 2 3
Call the action method Return the return value entrance name =  “ Hamed” Entrance.signIn() entrance name =  “ Hamed” Entrance.signIn() “ Yes” 1.name=“Hamed” action class=“Entrance“ action method=“signIn“ 1 3 5 action=“submit“ 4 return value=  6 “ Yes” 3 5 field=“name” 2
entrance name =  “ Hamed ” Value Stack Push the new object  name=“Hamed” action class=“Entrance“ action method=“signIn“ 1 3 5 action=“submit“ 4 return value=“Yes” 6 on top of value stack field=“name” 2
<action name=“submit”> <result name = “No”> … </result> <result name = “ Yes ”> welcome.jsp </result> </action> Find the target page  corresponding to return  value from “struts.xml” Go to the result page Welcome ……………… 5 name =“Hamed” action class=“Entrance“ action method=“signIn“ 1 2 3 action=“submit“ 4 return value=“Yes” 5 4 struts.xml <%@ taglib prefix=&quot;s&quot;  uri=&quot;/struts-tags&quot;%> Welcome <s:property  value=” name ”... welcome.jsp name field=“  ” 6
Value Stack Find the object from the top of value stack to initialize the result page (first object that has “name” property)  entrance_o Name =  “ Mohammad” entrance entrance name =  “ Hamed” Entrance.getName() entrance name =  “ Hamed” Entrance.getName() “ Hamed” Welcome ……………… Hamed 1.name=“Hamed” action class=“Entrance“ action method=“signIn“ 1 2 3 action=“submit“ 4 2 field=“name” 5 5 Retrieve name property  from action object

More Related Content

Viewers also liked

Struts2
Struts2Struts2
Struts2yuvalb
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 
CM Pros CMIS Overview - Jan 2011
CM Pros CMIS Overview  - Jan 2011CM Pros CMIS Overview  - Jan 2011
CM Pros CMIS Overview - Jan 2011Laurence Hart
 
EMC World 2009 - Standards: CMIS
EMC World  2009 - Standards: CMISEMC World  2009 - Standards: CMIS
EMC World 2009 - Standards: CMISLaurence Hart
 
Contratti Distanza
Contratti DistanzaContratti Distanza
Contratti Distanzaguesta30844
 
An Open Approach to Information Governance
An Open Approach to Information GovernanceAn Open Approach to Information Governance
An Open Approach to Information GovernanceLaurence Hart
 
Content Management Market Trends
Content Management Market TrendsContent Management Market Trends
Content Management Market TrendsLaurence Hart
 
Class Is For Messy Clothes
Class Is For Messy ClothesClass Is For Messy Clothes
Class Is For Messy Clothesrusev
 
Removing the “Work” from Information Governance
Removing the “Work” from Information GovernanceRemoving the “Work” from Information Governance
Removing the “Work” from Information GovernanceLaurence Hart
 
Using Dita To Provide Consistent Communications To The Public
Using Dita To Provide Consistent Communications To The PublicUsing Dita To Provide Consistent Communications To The Public
Using Dita To Provide Consistent Communications To The PublicLaurence Hart
 
Streamlining Content Management Using Portal Technologies
Streamlining Content Management Using Portal TechnologiesStreamlining Content Management Using Portal Technologies
Streamlining Content Management Using Portal TechnologiesLaurence Hart
 
Ian Malone Basic Portfolio
Ian Malone  Basic PortfolioIan Malone  Basic Portfolio
Ian Malone Basic Portfolioianmalone
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overviewskill-guru
 
Presentación Nico Calavita
Presentación Nico CalavitaPresentación Nico Calavita
Presentación Nico CalavitaVisnja Tomicic
 
SP2010 Overview and Upgrade Planning, Web Content Mavens
SP2010 Overview and Upgrade Planning, Web Content MavensSP2010 Overview and Upgrade Planning, Web Content Mavens
SP2010 Overview and Upgrade Planning, Web Content MavensLaurence Hart
 
The Future of Content Management - AIIM Conference 2011
The Future of Content Management - AIIM Conference 2011The Future of Content Management - AIIM Conference 2011
The Future of Content Management - AIIM Conference 2011Laurence Hart
 
Overview of CMIS in June 2010
Overview of CMIS in June 2010Overview of CMIS in June 2010
Overview of CMIS in June 2010Laurence Hart
 
Infection control powerpoint garnett
Infection control powerpoint garnettInfection control powerpoint garnett
Infection control powerpoint garnettrusev
 

Viewers also liked (20)

Struts2
Struts2Struts2
Struts2
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
CM Pros CMIS Overview - Jan 2011
CM Pros CMIS Overview  - Jan 2011CM Pros CMIS Overview  - Jan 2011
CM Pros CMIS Overview - Jan 2011
 
EMC World 2009 - Standards: CMIS
EMC World  2009 - Standards: CMISEMC World  2009 - Standards: CMIS
EMC World 2009 - Standards: CMIS
 
Contratti Distanza
Contratti DistanzaContratti Distanza
Contratti Distanza
 
An Open Approach to Information Governance
An Open Approach to Information GovernanceAn Open Approach to Information Governance
An Open Approach to Information Governance
 
Content Management Market Trends
Content Management Market TrendsContent Management Market Trends
Content Management Market Trends
 
Class Is For Messy Clothes
Class Is For Messy ClothesClass Is For Messy Clothes
Class Is For Messy Clothes
 
Struts2
Struts2Struts2
Struts2
 
Removing the “Work” from Information Governance
Removing the “Work” from Information GovernanceRemoving the “Work” from Information Governance
Removing the “Work” from Information Governance
 
Struts 2
Struts 2Struts 2
Struts 2
 
Using Dita To Provide Consistent Communications To The Public
Using Dita To Provide Consistent Communications To The PublicUsing Dita To Provide Consistent Communications To The Public
Using Dita To Provide Consistent Communications To The Public
 
Streamlining Content Management Using Portal Technologies
Streamlining Content Management Using Portal TechnologiesStreamlining Content Management Using Portal Technologies
Streamlining Content Management Using Portal Technologies
 
Ian Malone Basic Portfolio
Ian Malone  Basic PortfolioIan Malone  Basic Portfolio
Ian Malone Basic Portfolio
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overview
 
Presentación Nico Calavita
Presentación Nico CalavitaPresentación Nico Calavita
Presentación Nico Calavita
 
SP2010 Overview and Upgrade Planning, Web Content Mavens
SP2010 Overview and Upgrade Planning, Web Content MavensSP2010 Overview and Upgrade Planning, Web Content Mavens
SP2010 Overview and Upgrade Planning, Web Content Mavens
 
The Future of Content Management - AIIM Conference 2011
The Future of Content Management - AIIM Conference 2011The Future of Content Management - AIIM Conference 2011
The Future of Content Management - AIIM Conference 2011
 
Overview of CMIS in June 2010
Overview of CMIS in June 2010Overview of CMIS in June 2010
Overview of CMIS in June 2010
 
Infection control powerpoint garnett
Infection control powerpoint garnettInfection control powerpoint garnett
Infection control powerpoint garnett
 

Similar to Struts 2 Second Scenario

Basic Object Oriented Concepts
Basic Object Oriented ConceptsBasic Object Oriented Concepts
Basic Object Oriented ConceptsScott Lee
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...Ho Chi Minh City Software Testing Club
 
Swift - Modern & Expressive, or Magical Unicorn?
Swift  - Modern & Expressive, or Magical Unicorn?Swift  - Modern & Expressive, or Magical Unicorn?
Swift - Modern & Expressive, or Magical Unicorn?Mike Jones
 
Javascript Primer
Javascript PrimerJavascript Primer
Javascript PrimerAdam Hepton
 
GeeCON Prague 2014 - Metaprogramming with Groovy
GeeCON Prague 2014 - Metaprogramming with GroovyGeeCON Prague 2014 - Metaprogramming with Groovy
GeeCON Prague 2014 - Metaprogramming with GroovyIván López Martín
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokusHamletDRC
 
Design Patterns the Ruby way - ConFoo 2015
Design Patterns the Ruby way - ConFoo 2015Design Patterns the Ruby way - ConFoo 2015
Design Patterns the Ruby way - ConFoo 2015Fred Heath
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using RoomNelson Glauber Leal
 
Best practices for crafting high quality PHP apps (Bulgaria 2019)
Best practices for crafting high quality PHP apps (Bulgaria 2019)Best practices for crafting high quality PHP apps (Bulgaria 2019)
Best practices for crafting high quality PHP apps (Bulgaria 2019)James Titcumb
 
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Scott Wlaschin
 
Groovy vs Boilerplate and Ceremony Code
Groovy vs Boilerplate and Ceremony CodeGroovy vs Boilerplate and Ceremony Code
Groovy vs Boilerplate and Ceremony Codestasimus
 
Object Oriented JavaScript
Object Oriented JavaScriptObject Oriented JavaScript
Object Oriented JavaScriptJulie Iskander
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Tsuyoshi Yamamoto
 
JavaScript In Object Oriented Way
JavaScript In Object Oriented WayJavaScript In Object Oriented Way
JavaScript In Object Oriented WayBorey Lim
 

Similar to Struts 2 Second Scenario (20)

Basic Object Oriented Concepts
Basic Object Oriented ConceptsBasic Object Oriented Concepts
Basic Object Oriented Concepts
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
 
Swift - Modern & Expressive, or Magical Unicorn?
Swift  - Modern & Expressive, or Magical Unicorn?Swift  - Modern & Expressive, or Magical Unicorn?
Swift - Modern & Expressive, or Magical Unicorn?
 
Scala taxonomy
Scala taxonomyScala taxonomy
Scala taxonomy
 
Javascript Primer
Javascript PrimerJavascript Primer
Javascript Primer
 
GeeCON Prague 2014 - Metaprogramming with Groovy
GeeCON Prague 2014 - Metaprogramming with GroovyGeeCON Prague 2014 - Metaprogramming with Groovy
GeeCON Prague 2014 - Metaprogramming with Groovy
 
AST Transformations at JFokus
AST Transformations at JFokusAST Transformations at JFokus
AST Transformations at JFokus
 
Design Patterns the Ruby way - ConFoo 2015
Design Patterns the Ruby way - ConFoo 2015Design Patterns the Ruby way - ConFoo 2015
Design Patterns the Ruby way - ConFoo 2015
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
FalcorJS
FalcorJSFalcorJS
FalcorJS
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
 
Best practices for crafting high quality PHP apps (Bulgaria 2019)
Best practices for crafting high quality PHP apps (Bulgaria 2019)Best practices for crafting high quality PHP apps (Bulgaria 2019)
Best practices for crafting high quality PHP apps (Bulgaria 2019)
 
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
 
Groovy vs Boilerplate and Ceremony Code
Groovy vs Boilerplate and Ceremony CodeGroovy vs Boilerplate and Ceremony Code
Groovy vs Boilerplate and Ceremony Code
 
Java 8 revealed
Java 8 revealedJava 8 revealed
Java 8 revealed
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
 
Object Oriented JavaScript
Object Oriented JavaScriptObject Oriented JavaScript
Object Oriented JavaScript
 
Elegant objects
Elegant objectsElegant objects
Elegant objects
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
 
JavaScript In Object Oriented Way
JavaScript In Object Oriented WayJavaScript In Object Oriented Way
JavaScript In Object Oriented Way
 

Recently uploaded

Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceDamini Dixit
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...allensay1
 
Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperityhemanthkumar470700
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptxnandhinijagan9867
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...daisycvs
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...Aggregage
 
John Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfJohn Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfAmzadHosen3
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...amitlee9823
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfAdmir Softic
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1kcpayne
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Centuryrwgiffor
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...lizamodels9
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsP&CO
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...amitlee9823
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Dave Litwiller
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentationuneakwhite
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noidadlhescort
 

Recently uploaded (20)

Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
 
Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperity
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
John Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfJohn Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdf
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentation
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
 

Struts 2 Second Scenario

  • 1. How does struts work? Mohammad Seyed Alavi [email_address]
  • 2.
  • 3.
  • 4. Name: Submit Name: Submit Name: Submit Mohammad Mohammad Fill Form's Field Trigger the action Mohammad
  • 5. Name: Submit Incorrect name Name: Submit Incorrect name Hamed Correct the name & trigger the action Mohammad Welcome ……………… Hamed
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Name: Submit Name: Submit Name: Submit Mohammad Mohammad Fill Form's Field Trigger the action name =“ ” Mohammad 1 <%@ taglib prefix=&quot;s&quot; uri=&quot;/struts-tags&quot;%> <s:textfield name=” name ”... entrance.jsp Find the name’s field name 2 field=“ ”
  • 11. <s:form action = “ ” . . . <action name = “ ” class = “ ” method = “ ”> . . . Find the action name from “entrance.jsp” file Find the action class and method from &quot;struts.xml&quot; 1.name=“Mohammad” 2.action class=“ “ 3.action method=“ “ 1 3 5 2.action=“ “ 4 submit Entrance signIn submit Entrance signIn entrance.jsp struts.xml submit 1.field=“name” 2
  • 12. Value Stack An object of action class will be created if there is not any of that in value stack object maker Entrance entrance entrance name = “ Mohammad” There wasn't any object so make new one entrance_o Name = “ Mohammad” entrance Entrance.setName(“Mohammad”) entrance name = “ Mohammad” Entrance.setName(“Mohammad”) void call the setter name=“Mohammad” action class=“Entrance“ 3.action method=“signIn“ 1 3 5 2.action=“submit“ 4 3 1 2 field=“name” 2 3
  • 13. Call the action method Return the return value entrance name = “ Mohammad” Entrance.signIn() entrance name = “ Mohammad” Entrance.signIn() “ No” name=“Mohammad” action class=“Entrance“ action method=“signIn“ 1 3 5 2.action=“submit“ 4 3 5 return value= 6 “ No” field=“name” 2
  • 14. entrance name = “ Mohammad” Value Stack Push the object on top of value stack name=“Mohammad” action class=“Entrance“ action method=“signIn“ 1 3 5 2.action=“submit“ 4 return value=“No” 6 field=“name” 2
  • 15. <action name=“submit”> <result name = “ No ”> main.jsp?msg = “Incorrect name” </result> . . . </action> Find the target page corresponding to return value from “struts.xml” Name: Submit Go to the result page Incorrect name name=“Mohammad” action class=“Entrance“ action method=“signIn“ 1 2 3 action=“submit“ 4 return value=“No” 5 4 5 struts.xml field=“ ” 6 <%@ taglib prefix=&quot;s&quot; uri=&quot;/struts-tags&quot;%> Name: <s:textfield name=” name ”... entrance.jsp Find the name’s field name
  • 16. Value Stack Find the object from the top of value stack to initialize the result page (first object that has “name” property) entrance_o Name = “ Mohammad” entrance entrance name = “ Mohammad” Entrance.getName() entrance name = “ Mohammad” Entrance.getName() “ Mohammad” Name: Submit Incorrect name Mohammad Name: Submit Incorrect name Hamed Correct the name & trigger the action name=“ ” action class=“Entrance“ action method=“signIn“ 5 2 3 action=“submit“ 4 Hamed 2 1 field=“name” 1 Retrieve name property from action object
  • 17. 1.name=“Hamed” 1 field=“ ” 2 <%@ taglib prefix=&quot;s&quot; uri=&quot;/struts-tags&quot;%> Name: <s:textfield name=” name ”... entrance.jsp name Find the name’s field
  • 18. <s:form action = “ ” . . . <action name = “ ” class = “ ” method = “ ”> . . . Find the action name from “entrance.jsp” file Find the action class and method from &quot;struts.xml&quot; 1.name=“Hamed” 2.action class=“ “ 3.action method=“ “ 1 3 5 2.action=“ “ 4 submit Entrance signIn submit Entrance signIn entrance.jsp struts.xml submit field=“name” 2
  • 19. Value Stack New Request So, new value stack object maker Entrance entrance entrance name = “ Hamed” There wasn't any object so make new one entrance_o Name = “ Mohammad” entrance Entrance.setName(“Hamed”) entrance name = “ Hamed” Entrance.setName(“Hamed”) void call the setter name=“Hamed” action class=“Entrance“ 3.action method=“signIn“ 1 3 5 2.action=“submit“ 4 3 1 2 field=“name” 2 3
  • 20. Call the action method Return the return value entrance name = “ Hamed” Entrance.signIn() entrance name = “ Hamed” Entrance.signIn() “ Yes” 1.name=“Hamed” action class=“Entrance“ action method=“signIn“ 1 3 5 action=“submit“ 4 return value= 6 “ Yes” 3 5 field=“name” 2
  • 21. entrance name = “ Hamed ” Value Stack Push the new object name=“Hamed” action class=“Entrance“ action method=“signIn“ 1 3 5 action=“submit“ 4 return value=“Yes” 6 on top of value stack field=“name” 2
  • 22. <action name=“submit”> <result name = “No”> … </result> <result name = “ Yes ”> welcome.jsp </result> </action> Find the target page corresponding to return value from “struts.xml” Go to the result page Welcome ……………… 5 name =“Hamed” action class=“Entrance“ action method=“signIn“ 1 2 3 action=“submit“ 4 return value=“Yes” 5 4 struts.xml <%@ taglib prefix=&quot;s&quot; uri=&quot;/struts-tags&quot;%> Welcome <s:property value=” name ”... welcome.jsp name field=“ ” 6
  • 23. Value Stack Find the object from the top of value stack to initialize the result page (first object that has “name” property) entrance_o Name = “ Mohammad” entrance entrance name = “ Hamed” Entrance.getName() entrance name = “ Hamed” Entrance.getName() “ Hamed” Welcome ……………… Hamed 1.name=“Hamed” action class=“Entrance“ action method=“signIn“ 1 2 3 action=“submit“ 4 2 field=“name” 5 5 Retrieve name property from action object