Spring Web Flow 2.0.0.RC1已经发布,这是一个重要的里程碑版本,它带来了许多改进和新特性

Spring Web Flow 2.0.0.RC1已经发布,这是一个重要的里程碑版本,它带来了许多改进和新特性。Spring Web Flow是一个用于构建基于Web的应用程序的框架,它提供了一种声明式的方式来定义和管理Web应用程序的流程控制。

这个版本的主要更新包括:

  1. 支持Spring Framework 5.x和Spring Boot 2.x,这使得开发者可以在最新的Spring生态系统中使用Spring Web Flow。
  2. 引入了一种新的配置方式,使得开发者可以更容易地自定义和扩展Spring Web Flow的行为。
  3. 增加了对Java 8的支持,包括Lambda表达式和Stream API,这使得开发者可以使用更现代的Java特性来编写代码。
  4. 改进了文档和示例,使得开发者可以更容易地理解和使用Spring Web Flow。

总的来说,Spring Web Flow 2.0.0.RC1是一个值得期待的版本,它为开发者提供了更多的灵活性和便利性,使得他们可以更容易地构建复杂的Web应用程序。
Spring Web Flow 2.0.0.RC1与Spring Framework 5.x和Spring Boot 2.x的集成主要通过以下步骤实现:

  1. 添加依赖: 首先,在你的项目中需要添加Spring Web Flow的依赖。如果你的项目是基于Maven构建的,你可以在pom.xml文件中添加相应的依赖项。对于Spring Web Flow 2.0.0.RC1,你可以添加如下依赖:

    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-webflow</artifactId>
        <version>2.0.0.RC1</version>
    </dependency>
    
  2. 配置WebFlow: 在Spring Boot应用中,你需要创建一个WebFlow配置类,这个类应该继承AbstractFlowConfiguration并重写registerFlowDefinitionSets方法来注册你的流程定义文件。例如:

    @Configuration
    public class WebFlowConfig extends AbstractFlowConfiguration {
        @Autowired
        private ApplicationContext context;
    
        @Bean
        public FlowExecutor flowExecutor() {
            return getFlowExecutor();
        }
    
        @Bean
        public FlowRegistry flowRegistry() {
            return getFlowRegistry();
        }
    
        @Bean
        public FlowBuilderServices flowBuilderServices() {
            return getFlowBuilderServices();
        }
    
        @Override
        protected void registerFlowDefinitionSets(FlowDefinitionRegistry registry) {
            registry.setBasePath("/WEB-INF/flows");
        }
    }
    
  3. 创建流程定义文件: 在你的资源目录中(通常是src/main/resources),创建一个名为“flows”的文件夹,并在其中创建XML格式的流程定义文件。这些文件定义了WebFlow中的流程逻辑。

  4. 启动WebFlow: 确保你的Spring Boot应用能够启动,并且正确配置了WebFlow。你可以通过访问特定的URL来触发一个流程实例,例如http://localhost:8080/appName/flowName

  5. 处理异常和错误: 在实际应用中,你可能还需要处理一些异常和错误情况,比如流程执行过程中出现的异常。这可以通过自定义异常处理器来实现。

通过以上步骤,你可以将Spring Web Flow 2.0.0.RC1成功集成到使用Spring Framework 5.x和Spring Boot 2.x的项目中。这种集成可以帮助你在Java Web应用中实现复杂的业务流程管理。

We are pleased to announce that Spring Web Flow 2.0.0.RC1 is now available. Download | Documentation

2.0.0.RC1 introduces several new features, and fixes all known issues reported against previous milestones.

We recommend upgrading to 2.0.0.RC1 from previous Web Flow 2 milestones. We also recommend Web Flow 1 users begin evaluating their upgrade to Web Flow 2 at this time, as RC1 introduces comprehensive version 2 documentation, as well as a tool for automating the conversion of version 1 flows to the version 2 syntax.

The best way to get started with Web Flow 2 is to evaluate the reference applications included in the distribution and supplement with the reference guide. Spring Web Flow 2 requires Spring Framework 2.5.3 and Java 1.4 or above.

Find the new and noteworthy in the 2.0.0 RC1 release below:
2.0.0.RC1 New and Noteworthy

Introduced the Web Flow 2 reference guide, available in PDF and HTML format. The new guide is written in "quick reference" style with runnable code examples. Read it on-line, or download the printable PDF.

Added support for upgrading from Web Flow 1 to 2. Included in this distribution is a WebFlowUpgrader tool capable of converting flows from the version 1 syntax to the version 2 syntax. See the reference guide for instructions on how to use this tool

Added support for flow definition inheritance. With this feature, A flow may extend one or more flows. A flow state can also extend another state. This feature is used to facilitate reuse between flows and states that share a common structure.

Introduced Spring Portlet MVC support. See the Portlet section of the reference guide and the booking-mvc-portlet and booking-faces-portlet sample applications for examples.

Formally introduced the new "Spring Javascript" module, included within spring-js-2.0.0.RC1.jar. This module provides a Javascript abstraction framework for applying client-side behaviors such as form validation and Ajax in a consistent manner. It also bundles a ResourceServlet for serving Javascript and CSS from jars (a CSS framework is included as well). The default UI toolkit this framework builds upon is Dojo 1. Spring’s JSF integration module called "Spring Faces" builds on spring-js to provide a lightweight JSF component library for form validation and Ajax.

Added Spring Faces integration with the RichFaces JSF component library. Rich Faces can be used with the Spring Faces component library or used standalone. A sample application illustrating this integration is available in our JIRA system.

Added a "jsf-booking" reference application that offers a comparsion between a traditional JSF web application and a Spring web application that uses JSF as the UI component model. Compare jsf-booking with booking-faces to see the differences in the architectural approach and implementation. This comparison is particularly relevant to JSF developers interested in learning more about Spring.

Introduced support for automatic model binding and validation with Spring MVC. This support provides a concise alternative to manual FormAction setupForm and bindAndValidate calls. This support also allows registration of data input Formatters application wide, reducing the need to manually register PropertyEditors on a view-by-view basis in many cases. Support for suppressing data binding for a event such as a cancel button click is provided. Support for invoking validators by convention is provided. See the booking-mvc sample for an example.

Introduced view scope. View scope is allocated when a view-state enters and destroyed when a view-state exits. The scope is useful for updating a model specific to one view over a series of Ajax requests. It is also the scope used to manage JSF component state.

Added support for flow message bundles. Create a messages.properties file in your flow’s working directory for the Locales you need to support and off you go.

Introduced configurable view-state history polices. A view state can preserve its history to support backtracking, discard its history to prevent backtracking, and invalidate all previous history to disallow backtracking after a point of no return. See the new ‘history’ attribute on the view-state element.

Refined the flow execution snapshotting process. These refinements capture view-state form values on postback to support restoring those values when backtracking. This preserves edits when going back using the browser back button for data stored in flow scope.

Simplified flow execution testing by allowing you to jump to any state to begin a test case. See the booking-mvc and booking-faces for examples of flow test cases.

Improved booking-mvc as a reference application showing @Controllers together with Flows. A new FlowHandler concept provides a clean bridge between Controllers and Flows, allowing the two types of handlers to interact in a structured manner. Also improved the organization of the reference application Spring configuration to illustrate best practice.

2.0.0 Final is right around the corner! Enjoy!

comments powered by Disqus

translate:
翻译:

亲爱的春季社区,

我们很高兴地宣布,Spring Web Flow 2.0.0.RC1现在可用。下载|文献资料

2.0.0.RC1引入了几个新功能,并针对以前的里程碑修复了所有已知问题。

我们建议从以前的Web Flow 2里程碑升级到2.0.0.RC1。我们还建议Web Flow 1用户此时开始评估其对Web Flow 2的升级,因为RC1引入了全面的版本2文档以及用于自动将版本1流转换为版本2语法的工具。

入门Web Flow 2的最佳方法是评估发行版中包含的参考应用程序,并补充参考指南。 Spring Web Flow 2需要Spring Framework 2.5.3和Java 1.4或更高版本。

在下面的2.0.0 RC1版本中找到新的和值得注意的:
2.0.0.RC1全新且值得注意

引入了Web Flow 2参考指南,提供PDF和HTML格式。新指南以“快速参考”样式编写,带有可运行的代码示例。在线阅读,或下载可打印的PDF。

添加了对从Web Flow 1升级到2的支持。此发行版中包括一个WebFlowUpgrader工具,该工具能够将流从版本1语法转换为版本2语法。有关如何使用此工具的说明,请参见参考指南。

添加了对流定义继承的支持。使用此功能,流可以扩展一个或多个流。流状态还可以扩展另一个状态。此功能用于促进共享公共结构的流和状态之间的重用。

引入了Spring Portlet MVC支持。有关示例,请参见参考指南的“ Portlet”部分以及booking-mvc-portlet和booking-faces-portlet示例应用程序。

正式引入了新的“ Spring Javascript”模块,该模块包含在spring-js-2.0.0.RC1.jar中。此模块提供了Javascript抽象框架,用于以一致的方式应用客户端行为,例如表单验证和Ajax。它还捆绑了一个ResourceServlet,用于从jar中提供Java脚本和CSS(也包括一个CSS框架)。该框架所基于的默认UI工具包是Dojo1。Spring的JSF集成模块“ Spring Faces”基于spring-js构建,以提供用于表单验证和Ajax的轻量级JSF组件库。

添加了Spring Faces与RichFaces JSF组件库的集成。 Rich Faces可以与Spring Faces组件库一起使用,也可以独立使用。我们的JIRA系统中提供了一个示例应用程序,说明了这种集成。

添加了一个“ jsf-booking”参考应用程序,该应用程序提供了传统JSF Web应用程序和使用JSF作为UI组件模型的Spring Web应用程序之间的比较。将jsf预订与预订界面进行比较,以了解架构方法和实现方面的差异。这种比较与对学习更多有关Spring感兴趣的JSF开发人员特别相关。

引入了对使用Spring MVC进行自动模型绑定和验证的支持。此支持提供了手动FormAction setupForm和bindAndValidate调用的简洁替代方案。此支持还允许在应用程序范围内注册数据输入Formatters,从而在许多情况下减少了逐个视图手动注册PropertyEditor的需要。提供了对禁止诸如取消按钮单击之类的事件的数据绑定的支持。提供了按约定调用验证器的支持。有关示例,请参见booking-mvc示例。

引入了视图范围。在进入视图状态时分配视图范围,并在退出视图状态时销毁视图范围。该范围对于在一系列Ajax请求上更新特定于一个视图的模型很有用。它也是用于管理JSF组件状态的范围。

添加了对流消息捆绑包的支持。在流程的工作目录中为您需要支持的语言环境创建一个messages.properties文件,然后离开。

引入了可配置的视图状态历史记录策略。视图状态可以保留其历史记录以支持回溯,可以丢弃其历史记录以防止回溯,并使所有先前的历史记录无效以禁止在没有返回点之后进行回溯。查看view-state元素上的新“ history”属性。

完善流程执行快照过程。这些改进在回发时捕获视图状态表单值,以支持在回溯时恢复这些值。当使用浏览器后退按钮返回流范围中存储的数据时,这将保留编辑。

通过允许您跳至任何状态以开始测试案例,简化了流程执行测试。有关流测试用例的示例,请参见booking-mvc和booking-faces。

在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值