Spring Web Flow 2.5.1

Spring Web Flow builds on Spring MVC and allows implementing the “flows” of a web application. A flow encapsulates a sequence of steps that guide a user through the execution of some business task. It spans multiple HTTP requests, has state, deals with transactional data, is reusable, and may be dynamic and long-running in nature.

The sweet spot for Spring Web Flow are stateful web applications with controlled navigation such as checking in for a flight, applying for a loan, shopping cart checkout, or even adding a confirmation step to a form. What these scenarios have in common is one or more of the following traits:

There is a clear start and an end point.

The user must go through a set of screens in a specific order.

The changes are not finalized until the last step.

Once complete it shouldn’t be possible to repeat a transaction accidentally

Spring Web Flow provides a declarative flow definition language for authoring flows on a higher level of abstraction. It allows it to be integrated into a wide range of applications without any changes (to the flow programming model) including Spring MVC, JSF, and even Portlet web applications. The following are common issues observed in stateful web applications with navigation requirements:

Visualizing the flow is very difficult.

The application has a lot of code accessing the HTTP session.

Enforcing controlled navigation is important but not possible.

Proper browser back button support seems unattainable.

Browser and server get out of sync with "Back" button use.

Multiple browser tabs causes concurrency issues with HTTP session data.

Spring Web Flow provides a solution to the above issues.

Spring Boot Config

To use Spring Web Flow, add the following dependency to your application.
Maven

org.springframework.webflow spring-webflow 2.5.1.RELEASE

Gradle

dependencies {
compile ‘org.springframework.webflow:spring-webflow:2.5.1.RELEASE’
}

Spring Initializr
Quickstart Your Project
Bootstrap your application with Spring Initializr.

translate:
翻译:

Spring Web Flow建立在Spring MVC之上,允许实现Web应用程序的“流”。流封装了一系列步骤,这些步骤指导用户执行某些业务任务。它跨越多个HTTP请求,具有状态,处理事务数据,可重用,并且在本质上可能是动态的和长时间运行的。
Spring Web Flow最适合的地方是有状态的Web应用程序,它有控制的导航,比如签入航班、申请贷款、购物车结帐,甚至向表单添加确认步骤。这些场景的共同点是以下一个或多个特征:
有一个明确的起点和终点。
用户必须按特定顺序浏览一组屏幕。
直到最后一步,更改才最终确定。
一旦完成,就不可能意外地重复一个事务
Spring Web Flow提供了一种声明性的流定义语言,用于在更高抽象级别上编写流。它允许在不做任何更改的情况下(对流编程模型)将它集成到广泛的应用程序中,包括Spring MVC、JSF,甚至Portlet web应用程序。以下是在具有导航要求的有状态web应用程序中观察到的常见问题:
可视化流程非常困难。
应用程序有很多代码访问HTTP会话。
实施受控导航很重要,但不可能。
正确的浏览器后退按钮支持似乎无法实现。
浏览器和服务器与“后退”按钮的使用不同步。
多个浏览器选项卡会导致HTTP会话数据的并发问题。
Spring Web Flow提供了上述问题的解决方案。
弹簧靴配置
要使用Spring Web Flow,请将以下依赖项添加到应用程序中。
马文
<依赖项>
<依赖项>

org.springframework.webflow

spring webflow

2.5.1.版本

</依赖性>

</依赖项>
梯度
依赖关系{
编译’org.springframework.webflow:springwebflow:2.5.1.RELEASE’

}

弹簧初始化器
快速启动项目
使用Spring初始化器引导应用程序。

发布了0 篇原创文章 · 获赞 152 · 访问量 7035

猜你喜欢

转载自blog.csdn.net/blog_programb/article/details/105293056