SlideShare una empresa de Scribd logo
1 de 26
Introducing
Spring Web Flow
Emad Omara
1
May 30, 2016
Agenda
• Why do we need SWF ?
• What is SWF ?
• How it works ?
• Demo
2
The Navigation problem !
 response.sendRedirect(“page.jsp");
 Spring MVC :
@RequestMapping("/operation")
public String processOperationPage() { return “/corpus/operation"; }
- Struts
<action-mappings> …. <forward name="name" path="/name.jsp"/> </ action-mappings>
- JSF
<navigation-rule><navigation-case>
<from-outcome>page2</from-outcome>
<to-view-id>/page2.xhtml</to-view-id>
</navigation-case> </navigation-rule> 3
Disadvantages
 Visualizing the flow is very difficult
 Mixed navigation and view
 Overall navigation rules complexity
 Lack of state control/navigation customization
4
What is Spring Web Flow?
 Spring MVC extension
 Introduces flows concept
 Extends application scopes
 Web flows are designed to be self contained, and thus
are reusable multiple of times
 UML Like diagram 
5
Important Classes
 FlowDefinition - This class stores the definition of the flow. It contains the set of states that form
part of the flow. Each flow has one start state.
 FlowRegistry - This class contains all the flow definitions.
 FlowHandlerMapping - This is a HandlerMapping that creates a URL from the ids registered in the
flow registry. It returns a FlowHandler if a matching id is found in the flow registry.
 FlowHandler - This is a controller helper that has the reference to the actual flow. It handles the
execution of the flow, its outcomes and exceptions.
 FlowHandlerAdapter - This is the HandlerAdapter for web flows. It delegates work to the mapped
FlowHandler.
 FlowExecutor - This is the central class of the Flow and is the facade for the actual flow. It manages
creating of new flows or resuming existing flows. It is an entry into the Spring web flow system.
6
Request Diagram
System Setup
 Web Flow schema :
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.4.xsd">
<!-- Setup Web Flow here -->
</beans>
8
System Setup 2 (Flow Registry)
URL : /WEB-INF/flows/hotels/booking/booking-flow.xml
9
Flow ID=/hotels/booking
Flow ID=springpizza
Flow ID=pizza
System Setup 3
10
Flow
 A flow defines a dialogue, between users and server that meets business goal
11
Flow Essential elements
 State
 Transition
 Flow data
 Expression language
12
Flow States
 View States : A view state displays information to a user or obtains user input using a
form. (e.g. JSP)
 Action States : Action states are where actions are perfomed by the spring beans. The
action state transitions to another state. The action states generally have an evaluate
property that describes what needs to be done.
 Decision States: A decision state has two transitions depending on whether the
decision evaluates to true or false.
 Subflow States :It may be advantageous to call another flow from one flow to
complete some steps. Passing inputs and expecting outputs.
 End States : The end state signifies the end of flow. If the end state is part of a root flow
then the execution is ended. However, if its part of a sub flow then the root flow is resumed.
13
Flow Data Scopes
 Flow Data can be stored as variables that can be created using the 'var' element.
 Variable scope - The lifespan of the variable depends on the scope with which it is declared. The
scopes available are:
 Request - Available during the life of a request in a flow
 Flash -Extended request scope for PRG case , Useful for rendering error/warning messages
 View - Available only during the lifetime of a view. Created when a view is created and destroyed once a
view is destroyed
 Flow - Available within a flow. Not available in sub flows
 Conversation - The conversation scope starts when a flow starts and ends when the flow ends. It is available
in sub flows
14
Flow elements
15
View State
16
Decision State
17
Action State
18
Sub Flow State
19
Input attributes
20
Output Value
21
Firing Events
22
Events
23
References
 Web Flow reference
 http://static.springframework.org/spring-webflow/docs/2.3.x/reference/html/index.html
 samples
 https://github.com/spring-projects/spring-webflow-samples
 Spring Web Flow 2 Web Development
 https://www.safaribooksonline.com/library/view/spring-web-flow/9781847195425/pr01.html
 Refcardz
 http://refcardz.dzone.com/refcardz/spring-web-flow
24
Demo
25
Thank you
Emad
26

Más contenido relacionado

La actualidad más candente

Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVCGuy Nir
 
Using Java to implement SOAP Web Services: JAX-WS
Using Java to implement SOAP Web Services: JAX-WS�Using Java to implement SOAP Web Services: JAX-WS�
Using Java to implement SOAP Web Services: JAX-WSKatrien Verbert
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSam Brannen
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component BehaviorsAndy Schwartz
 
Lecture 7 Web Services JAX-WS & JAX-RS
Lecture 7   Web Services JAX-WS & JAX-RSLecture 7   Web Services JAX-WS & JAX-RS
Lecture 7 Web Services JAX-WS & JAX-RSFahad Golra
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITCarol McDonald
 
Basic example using message properties component
Basic example using message properties componentBasic example using message properties component
Basic example using message properties componentprudhvivreddy
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Peter R. Egli
 
Java web application development
Java web application developmentJava web application development
Java web application developmentRitikRathaur
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsBG Java EE Course
 
Lecture 4: JavaServer Pages (JSP) & Expression Language (EL)
Lecture 4:  JavaServer Pages (JSP) & Expression Language (EL)Lecture 4:  JavaServer Pages (JSP) & Expression Language (EL)
Lecture 4: JavaServer Pages (JSP) & Expression Language (EL)Fahad Golra
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSCarol McDonald
 
9. java server faces
9. java server faces9. java server faces
9. java server facesAnusAhmad
 
Spring Web Services
Spring Web ServicesSpring Web Services
Spring Web ServicesEmprovise
 
Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)Fahad Golra
 
Jax ws
Jax wsJax ws
Jax wsF K
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkGuo Albert
 

La actualidad más candente (20)

Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVC
 
Using Java to implement SOAP Web Services: JAX-WS
Using Java to implement SOAP Web Services: JAX-WS�Using Java to implement SOAP Web Services: JAX-WS�
Using Java to implement SOAP Web Services: JAX-WS
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component Behaviors
 
Lecture 7 Web Services JAX-WS & JAX-RS
Lecture 7   Web Services JAX-WS & JAX-RSLecture 7   Web Services JAX-WS & JAX-RS
Lecture 7 Web Services JAX-WS & JAX-RS
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 
Basic example using message properties component
Basic example using message properties componentBasic example using message properties component
Basic example using message properties component
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)
 
Java web application development
Java web application developmentJava web application development
Java web application development
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 
Lecture 4: JavaServer Pages (JSP) & Expression Language (EL)
Lecture 4:  JavaServer Pages (JSP) & Expression Language (EL)Lecture 4:  JavaServer Pages (JSP) & Expression Language (EL)
Lecture 4: JavaServer Pages (JSP) & Expression Language (EL)
 
SpringMVC
SpringMVCSpringMVC
SpringMVC
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
9. java server faces
9. java server faces9. java server faces
9. java server faces
 
Spring Web Services
Spring Web ServicesSpring Web Services
Spring Web Services
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)Lecture 10 - Java Server Faces (JSF)
Lecture 10 - Java Server Faces (JSF)
 
Jax ws
Jax wsJax ws
Jax ws
 
Rest with Spring
Rest with SpringRest with Spring
Rest with Spring
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 

Destacado

Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005Kamil Kedzierski
 
FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014Ibrahim Hejab
 
FPGA/Reconfigurable computing (HPRC)
FPGA/Reconfigurable computing (HPRC)FPGA/Reconfigurable computing (HPRC)
FPGA/Reconfigurable computing (HPRC)rinnocente
 
fpga programming
fpga programmingfpga programming
fpga programmingAnish Gupta
 
Xilinx lca and altera flex
Xilinx lca and altera flexXilinx lca and altera flex
Xilinx lca and altera flexanishgoel
 

Destacado (7)

Formation Google App Engine
Formation Google App EngineFormation Google App Engine
Formation Google App Engine
 
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
Front–End Tools for Dynamic Reconfiguration in FPGA Devices 2005
 
FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014
 
FPGA/Reconfigurable computing (HPRC)
FPGA/Reconfigurable computing (HPRC)FPGA/Reconfigurable computing (HPRC)
FPGA/Reconfigurable computing (HPRC)
 
fpga programming
fpga programmingfpga programming
fpga programming
 
Xilinx lca and altera flex
Xilinx lca and altera flexXilinx lca and altera flex
Xilinx lca and altera flex
 
Fpga
FpgaFpga
Fpga
 

Similar a Introduction to Srping Web Flow

Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC SeminarJohn Lewis
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each componentprudhvivreddy
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVCJohn Lewis
 
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics RevisedSpark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics RevisedMichael Spector
 
6 10-presentation
6 10-presentation6 10-presentation
6 10-presentationRemi Arnaud
 
Spring Web Flow Grail's Plugin
Spring Web Flow Grail's PluginSpring Web Flow Grail's Plugin
Spring Web Flow Grail's PluginC-DAC
 
WS-VLAM workflow
WS-VLAM workflowWS-VLAM workflow
WS-VLAM workflowguest6295d0
 
Jlook web ui framework
Jlook web ui frameworkJlook web ui framework
Jlook web ui frameworkHongSeong Jeon
 
Guide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxGuide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxInexture Solutions
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Arun Gupta
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applicationselliando dias
 
Network visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetryNetwork visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetrypphaal
 

Similar a Introduction to Srping Web Flow (20)

Spring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 IntegrationSpring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 Integration
 
Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC Seminar
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
 
Spring Web Flow
Spring Web FlowSpring Web Flow
Spring Web Flow
 
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics RevisedSpark Streaming Recipes and "Exactly Once" Semantics Revised
Spark Streaming Recipes and "Exactly Once" Semantics Revised
 
6 10-presentation
6 10-presentation6 10-presentation
6 10-presentation
 
Struts Action
Struts ActionStruts Action
Struts Action
 
Spring Web Flow Grail's Plugin
Spring Web Flow Grail's PluginSpring Web Flow Grail's Plugin
Spring Web Flow Grail's Plugin
 
WS-VLAM workflow
WS-VLAM workflowWS-VLAM workflow
WS-VLAM workflow
 
Jsf Framework
Jsf FrameworkJsf Framework
Jsf Framework
 
Jlook web ui framework
Jlook web ui frameworkJlook web ui framework
Jlook web ui framework
 
Splitter
SplitterSplitter
Splitter
 
Spring mvc 2.0
Spring mvc 2.0Spring mvc 2.0
Spring mvc 2.0
 
Guide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxGuide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFlux
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applications
 
How to use soap component
How to use soap componentHow to use soap component
How to use soap component
 
Network visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetryNetwork visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetry
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Introduction to Srping Web Flow

  • 1. Introducing Spring Web Flow Emad Omara 1 May 30, 2016
  • 2. Agenda • Why do we need SWF ? • What is SWF ? • How it works ? • Demo 2
  • 3. The Navigation problem !  response.sendRedirect(“page.jsp");  Spring MVC : @RequestMapping("/operation") public String processOperationPage() { return “/corpus/operation"; } - Struts <action-mappings> …. <forward name="name" path="/name.jsp"/> </ action-mappings> - JSF <navigation-rule><navigation-case> <from-outcome>page2</from-outcome> <to-view-id>/page2.xhtml</to-view-id> </navigation-case> </navigation-rule> 3
  • 4. Disadvantages  Visualizing the flow is very difficult  Mixed navigation and view  Overall navigation rules complexity  Lack of state control/navigation customization 4
  • 5. What is Spring Web Flow?  Spring MVC extension  Introduces flows concept  Extends application scopes  Web flows are designed to be self contained, and thus are reusable multiple of times  UML Like diagram  5
  • 6. Important Classes  FlowDefinition - This class stores the definition of the flow. It contains the set of states that form part of the flow. Each flow has one start state.  FlowRegistry - This class contains all the flow definitions.  FlowHandlerMapping - This is a HandlerMapping that creates a URL from the ids registered in the flow registry. It returns a FlowHandler if a matching id is found in the flow registry.  FlowHandler - This is a controller helper that has the reference to the actual flow. It handles the execution of the flow, its outcomes and exceptions.  FlowHandlerAdapter - This is the HandlerAdapter for web flows. It delegates work to the mapped FlowHandler.  FlowExecutor - This is the central class of the Flow and is the facade for the actual flow. It manages creating of new flows or resuming existing flows. It is an entry into the Spring web flow system. 6
  • 8. System Setup  Web Flow schema : <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:webflow="http://www.springframework.org/schema/webflow-config" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.4.xsd"> <!-- Setup Web Flow here --> </beans> 8
  • 9. System Setup 2 (Flow Registry) URL : /WEB-INF/flows/hotels/booking/booking-flow.xml 9 Flow ID=/hotels/booking Flow ID=springpizza Flow ID=pizza
  • 11. Flow  A flow defines a dialogue, between users and server that meets business goal 11
  • 12. Flow Essential elements  State  Transition  Flow data  Expression language 12
  • 13. Flow States  View States : A view state displays information to a user or obtains user input using a form. (e.g. JSP)  Action States : Action states are where actions are perfomed by the spring beans. The action state transitions to another state. The action states generally have an evaluate property that describes what needs to be done.  Decision States: A decision state has two transitions depending on whether the decision evaluates to true or false.  Subflow States :It may be advantageous to call another flow from one flow to complete some steps. Passing inputs and expecting outputs.  End States : The end state signifies the end of flow. If the end state is part of a root flow then the execution is ended. However, if its part of a sub flow then the root flow is resumed. 13
  • 14. Flow Data Scopes  Flow Data can be stored as variables that can be created using the 'var' element.  Variable scope - The lifespan of the variable depends on the scope with which it is declared. The scopes available are:  Request - Available during the life of a request in a flow  Flash -Extended request scope for PRG case , Useful for rendering error/warning messages  View - Available only during the lifetime of a view. Created when a view is created and destroyed once a view is destroyed  Flow - Available within a flow. Not available in sub flows  Conversation - The conversation scope starts when a flow starts and ends when the flow ends. It is available in sub flows 14
  • 24. References  Web Flow reference  http://static.springframework.org/spring-webflow/docs/2.3.x/reference/html/index.html  samples  https://github.com/spring-projects/spring-webflow-samples  Spring Web Flow 2 Web Development  https://www.safaribooksonline.com/library/view/spring-web-flow/9781847195425/pr01.html  Refcardz  http://refcardz.dzone.com/refcardz/spring-web-flow 24

Notas del editor

  1. Method Signature ()  Which is empty without arguments because our method in this case (run) does not accept arguments, but in case we implement method that accept arguments we would give here arguments names without types because of course the interface as we said has only one method and they types are already known and lambda target is to eliminate the unnecessary syntax .   The second part is the implementation of the method body