下一代版本的Spring Web Flow已经发布了第一个里程碑版本。这个新版本在保持原有功能的基础上,增加了许多新的特性和改进,以更好地满足开发者的需求。以下是一些主要的新特性:
-
支持更多的视图技术:新版本的Spring Web Flow现在支持更多的视图技术,包括JSF、Thymeleaf等,这使得开发者可以更灵活地选择适合自己项目的视图技术。
-
增强的状态管理:新版本对状态管理进行了增强,提供了更多的状态转换选项和更强大的状态机模型,使得流程控制更加灵活和强大。
-
更好的集成性:新版本的Spring Web Flow与Spring的其他模块(如Spring MVC、Spring Security等)的集成性更强,可以更方便地进行项目开发和管理。
-
性能优化:新版本对性能进行了优化,提高了执行效率和响应速度,使得应用运行更加流畅。
-
丰富的文档和示例:新版本提供了更丰富的文档和示例,帮助开发者更快地上手和使用这个框架。
Spring Web Flow是一个用于构建Web应用程序的框架,它提供了一种声明式的方法来管理Web应用中的流程控制。通过使用Spring Web Flow,开发者可以定义复杂的工作流和状态转换逻辑,而无需编写大量的控制器代码。
Spring Web Flow的核心概念包括:
- 流程定义:通过XML或Java配置类来定义流程的状态和转换规则。
- 状态:表示流程中的一个步骤或阶段,每个状态可以包含一个或多个动作。
- 转换:定义了从一个状态到另一个状态的过渡条件和行为。
- 决策点:根据某些条件决定流程的下一步走向。
- 结束状态:标志着流程的结束。
使用Spring Web Flow,可以轻松地处理多步骤表单提交、向导式界面以及其他需要复杂导航逻辑的场景。它还支持与Spring框架的集成,使得开发者可以利用Spring提供的其他功能和服务。
Dear Spring Community,
We are pleased to announce that the first milestone of the next generation version of Spring Web Flow is now available. Spring Web Flow 2.0 M1 introduces several major new features, including support for flow-managed persistence contexts, improved support for Java Server Faces, full unified expression language (EL) support, and a more comprehensive sample web application.
Download | Practical Introduction | Samples | Reference Manual | Changelog
Spring Web Flow 2.0 is a next generation framework for developing Java web application controllers. The framework offers a unified runtime for executing stateless and stateful client interactions across a variety of environments.
Goal of the Web Flow 2.0 Release
Today, most application developers use Spring Web Flow to implement linear page flows, such as wizards, by plugging Web Flow into their “base” web framework such as Spring MVC. Such page flows exhibit linear navigational rules, are stateful, and form dynamic, self-contained modules of web application functionality. A good example is a loan application process: Web Flow’s unique flow definition language provides a natural programming model for implementing these types of processes.
The overall goal of Spring Web Flow 2.0 is to formally take the product from what it is today, a framework used primarily to implement linear wizards, to what it was always designed to become: a universal application controller engine for powering all types of client interactions. Such interactions include wizards, stateless “RESTful” interactions, and finer-grained, non-linear/asynchronous interactions often present in a “web 2.0” application.
Spring Web Flow 2.0 will provide the Spring community with a unified application controller framework and runtime, suitable for executing all types of client interactions, and capable of integrating a variety of view rendering technologies and UI component models. This unified runtime will enable consistent application of management instrumentation, security, AJAX, and managed persistence, among other unique features.
View the complete Spring Web Flow 2.0 Roadmap.
Web Flow 2.0 M1 New and Noteworthy
The first 2.0 release milestone introduces several major new features on the road to 2.0 final. These features are described below.
Flow Managed Persistence Contexts with JPA and Hibernate
Spring Web Flow 2.0 M1 introduces support for Flow Managed Persistence Contexts with Hibernate and JPA. The new Hotel Booking Sample application included in the release demonstrates this feature. Here is how it works in the context of the booking sample:
When a new hotel booking flow begins, a persistence context is created for you automatically.
As you progress through the flow, the persistence context is used for all data access operations automatically. You do not have to worry about locating the flow-bound EntityManager instance, or managing it in any way.
When you authorize a booking, all changes to managed persistent entities are committed and flushed back to the database automatically. If you choose to cancel your booking, none of your changes are committed.
The graphical Spring IDE view of this Hotel Booking flow is shown below:
Booking Flow
Improved Support for Java Server Faces (JSF)
Spring Web Flow 2.0 M1 introduces the Spring Faces module (spring-faces-2.0-m1.jar), a component shipped with the Web Flow distribution that contains first-class support for organizations developing web applications with Java Server Faces. The pre-existing Web Flow + JSF integration has been factored out to this project, and this project will be the home of all future JSF integration work.
The Spring Faces module provides the Spring community a dedicated project for exploring additional JSF integration opportunities. The initial work in 2.0 M1 introduces integration with Ext, a popular Javascript GUI widget framework. Several lightweight JSF UI Components are provided that encapsulate the rendering of rich Ext widgets. The approach we took allows Ext widgets to decorate standard JSF components, adding a desktop-like look-and-feel and additional UI behaviors such as client-side validation. The following Ext component decorators are provided in 2.0 M1:
A date validator component that performs rich client-side validation on a date text field, with a great-looking date chooser control.
A text validator that performs rich client-side validation on a free-form text input field.
A number validator that performs rich client-side validation on number text fields.
A screen-shot of the date validator control, also used in the Hotel Booking sample application, is shown below:
Ext controls look great, and because all UI behaviors execute client side the responsiveness of the UI is excellent. We will be adding further support in this area in future Web Flow release milestones, as part of the Spring Faces module.
Having a dedicated Spring Faces module also simplifies the process of setting up Spring Web Flow in a JSF environment. Before 2.0 M1, developers were required to modify faces-config.xml manually to setup the boilerplate Spring/SWF integration plumbing. With 2.0 m1, this setup is done for you automatically simply by including spring-faces-2.0-m1.jar in your classpath.
Unified Expression Language (EL) Support
Also new in this release is full support for the Unified EL, which provides an alternative to the OGNL-based expression parser currently used by default in Spring Web Flow. Use of the unified EL is now recommended for a JSF environment, and will become the default for JSF developers in future milestones.
An example EL expression used within the Hotel Booking flow definition is shown below:
The “id” expression above evaluates the current hotel identifier stored in Flow Scope. Note how there is no need for any explicit flowScope prefix here. The developer simply references the variable by its name, and the ELExpressionEvaluator handles resolving the variable by searching through the various scopes. This makes managed-bean references in Web Flow definitions 100% consistent with references in JSF views used for model binding expressions. For example, see the following snippet from the bookingForm.xhtml view:
2.0 Release Notes
Spring Web Flow 2.0 requires Spring 2.0 or greater and Java 1.4 or greater.
Spring Web Flow 2.0 will retain backwards compatability with the 1.0.x XML-based flow definition language as far as possible. It is expected that some SWF SPIs will change in future Web Flow 2.x milestones, as Web Flow evolves into a complete controller framework.
Future milestones of Spring Web Flow 2.0 will introduce new dialects for defining flows in real programming languages, providing more powerful alternatives to the current XML-based flow definition syntax. A POJO-based Java flow definition syntax is in the works, as is a Groovy-based approach. Also, high-level flow dialects for implementing REST-ful and CRUD flows will be introduced. Because the Web Flow definition API and execution runtime are separate from any concrete flow definition syntax, we can naturally introduce new syntaxes that engineer application controllers at runtime in different ways.
For JSF users, Spring Web Flow 2.0 and Spring Faces run on JSF 1.1 and JSF 1.2. The UI component libraries in the Spring Faces module are independent of the Web Flow runtime and may also be used with JSF’s default navigation handlers.
Spring Web Flow 2.0 will continue to provide full support for Servlet 2.4 or greater, Portlet 1.0 or greater, and JUnit 3.8.1 or greater environments.
Spring Web Flow 2.0 will continue to run in Struts 1.2 or greater and Spring MVC 2.0 or greater environments, and will also be usable as a standalone web application controller framework by 2.0 final.
comments powered by Disqus
translate:
翻译:
2.0发行说明
Spring Web Flow 2.0需要Spring 2.0或更高版本以及Java 1.4或更高版本。
Spring Web Flow 2.0将尽可能与基于XML的1.0.x流定义语言保持向后兼容性。随着Web Flow演变成一个完整的控制器框架,预计某些SWF SPI将在将来的Web Flow 2.x里程碑中发生变化。
Spring Web Flow 2.0的未来里程碑将引入新的方言,以实际的编程语言定义流程,为当前基于XML的流程定义语法提供更强大的替代方法。基于POJO的Java流定义语法以及基于Groovy的方法都在研究中。此外,还将介绍用于实现REST-ful和CRUD流的高级流方言。因为Web Flow定义API和执行运行时与任何具体的流定义语法是分开的,所以我们自然可以引入新的语法,以不同的方式在运行时对应用程序控制器进行工程设计。
对于JSF用户,Spring Web Flow 2.0和Spring Faces可在JSF 1.1和JSF 1.2上运行。 Spring Faces模块中的UI组件库独立于Web Flow运行时,也可以与JSF的默认导航处理程序一起使用。
Spring Web Flow 2.0将继续提供对Servlet 2.4或更高版本,Portlet 1.0或更高版本以及JUnit 3.8.1或更高版本环境的全面支持。
Spring Web Flow 2.0将继续在Struts 1.2或更高版本以及Spring MVC 2.0或更高版本的环境中运行,并且在最终版本2.0之前也可以用作独立的Web应用程序控制器框架。
由Disqus提供动力的评论