没事就学习了一下web flow,但是学习过程中发现中文资料很少,比较好的就是
Spring Web Flow 2.0 入门:
http://www.ibm.com/developerworks/cn/education/java/j-spring-webflow/index.html,现在网上很多资料是Web Flow 1的,web flow 2的资料比较少,并且学习过程中发现SWF1和SWF2差异非常大,学习过程中碰到不少问题,把学习过程记录下来,java框架学习过程中,一般第一个都是helloworld,所以参照Spring Web Flow 2.0 入门写了一个helloworld,关键点:
1.启动流(配置文件webmvc-config.xml):
<bean id="viewMappings" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <!--value>/webflow=flowController </value--> <prop key="/flow-helloworld-id">flowController</prop> </props> </property> <property name="defaultHandler"> <bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" /> </property> </bean>
配置flow-helloworld-id是注册flow(配置文件webflow-config.xml)中使用的ID,这样配置后带flow-helloworld-id字符串的请求将由flowController,来进行处理,流配置如下,同时指定流ID,如果不指定流ID,它默认使用流文件名称作为ID:
<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices"> <webflow:flow-location path="/WEB-INF/flows/helloworld.xml" id="flow-helloworld-id"/> </webflow:flow-registry>
这样启动流时,使用:
<a href="flow-helloworld-id">hello world start</a>
启动流后,使用:
<a href="${flowExecutionUrl}&_eventId=goto1">secondtpage</a>来控制流的流转:
flowExecutionUrl和_eventId都是流中的默认变量:
<view-state id="firstpage" view="firstpage"> <transition on="goto1" to="secondpage" /> </view-state>
这样点击上面链接,流对应goto1去匹配对应跳转。刚入门,原理方面的,还需要进一步学习,还是看源码实在.
附件没有添加需要用的包,这个直接使用web flow sample中用到的包。
相关推荐
Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面。Spring 框架提供了构建 Web 应用程序的全功能 MVC 模块。使用 Spring 可插入的 MVC 架构,从而在使用Spring进行WEB开发时,可以选择使用...
by-step through five progressively more complex web applications: from a "Hello World" app all the way to a robust Newspaper app with a custom user model, complete user authentication flow, foreign ...
Set up React and write your first "Hello world" web app; Create and use custom React components alongside generic DOM components; Build a data table component that lets you edit, sort, search, and ...
Set up React and write your first "Hello world" web app Create and use custom React components alongside generic DOM components Build a data table component that lets you edit, sort, search, and ...
Chapter 2:Hello World app Chapter 3:Pages app Chapter 4:Message Board app Chapter 5:Blog app Chapter 6:Forms Chapter 7:User Accounts Chapter 8:Custom User Model Chapter 9:User Authentication Chapter ...
Hello World! Anatomy of an Android Project Drawable Resources Building the Project Android Emulator Summary Chapter 5 Main Building Blocks A Real-World Example Activities Intents Services Content ...
(二) Jsp+servlet+bean版HelloWorld概览 105 (三) Jsp基本页面标签 116 1. 标签 116 2. contentType属性 118 3. pageEncoding属性 118 (四) form表单中的action,post和get 119 1. form中的action属性 119 2. from中...
2.3 Hello World示例 2.4 使用IDE 2.5 规约配置 2.6 运行Grails应用 2.7 测试Grails应用 2.8 部署Grails应用 2.9 所支持的Java EE容器 2.10 创建工件 2.11 生成Grails应用 3. 配置 3.1 基本配置 3.1.1 内置选项 ...
Node.js is a platform that lets you use JavaScript to easily program scalable network applications and web services....Instant Node.js Starter will begin with installation and your first Hello World ...
应用程序进行了细化的分类,并指导你构建第一个Hello World 样式的示例。 第2章:视图 第2章介绍屏幕上的iPhone 视图及对象。你将了解如何对视图进行布置、创建和排序,以创建iPhone 应用程序的骨架。还会了解视图...
Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面。今天先从写一个Spring MVC的HelloWorld开始,让我们看看如何搭建起一个Spring mvc的环境并运行程序,感兴趣的朋友一起学习吧
Hello World 是在我 14 岁的时候,现在我可以用 C、C++、Java、Javascript、python、visual basic、C# 编写它,并且还在学习新的编写方法。 当我不编码时,您会发现我在打羽毛球、乒乓球、卡罗姆和国际象棋。 我喝了...
1.9 构建hello world应用程序 19 1.9.1 创建iphone项目 19 1.9.2 运行主干 20 1.9.3 定制iphone项目 20 1.9.4 编辑标识信息 21 1.9.5 使用调试器 21 1.10 苹果公司的iphone开发人员计划 23 1.10.1 开发电话 ...
应用程序进行了细化的分类,并指导你构建第一个Hello World 样式的示例。 第2章:视图 第2章介绍屏幕上的iPhone 视图及对象。你将了解如何对视图进行布置、创建和排序,以创建iPhone 应用程序的骨架。还会了解视图...
应用程序进行了细化的分类,并指导你构建第一个Hello World 样式的示例。 第2章:视图 第2章介绍屏幕上的iPhone 视图及对象。你将了解如何对视图进行布置、创建和排序,以创建iPhone 应用程序的骨架。还会了解视图...
HelloWorld 第一个Ajax应用程序 第2章 浏览器中的JavaScript Test4Navigator.htm User-Agent检测法 Test4Window1.htm window对象属性 test4Alert.htm 系统对话框 Test4Timeout.htm 时间间隔和暂停 Test...
He successfully guides all of them by combining educational skills with real-world experience in consulting and developing systems for enterprises worldwide. Between 2001 and 2003, Mark was employed ...
HelloWorld 第一个Ajax应用程序 第2章 浏览器中的JavaScript Test4Navigator.htm User-Agent检测法 Test4Window1.htm window对象属性 test4Alert.htm 系统对话框 Test4Timeout.htm 时间间隔和暂停 Test4History....