`
flyeagle
  • 浏览: 211623 次
  • 来自: ...
社区版块
存档分类
最新评论
阅读更多

没事就学习了一下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中用到的包。

 

 

分享到:
评论

相关推荐

    1.springMVC_helloworld.zip

    Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面。Spring 框架提供了构建 Web 应用程序的全功能 MVC 模块。使用 Spring 可插入的 MVC 架构,从而在使用Spring进行WEB开发时,可以选择使用...

    Django for Beginners Learn web development with Django 2.0

    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 ...

    React Up & Running Building Web Applications

    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 ...

    React - Up & Running - Building Web Applications

    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 ...

    Django for Beginners: Learn web development with Django 2.1

    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 ...

    Learning Android: Develop Mobile Apps Using Java and Eclipse(第二版)

    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 ...

    从J2SE到J2EE知识点介绍

    (二) 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中...

    Grails 中文参考手册

    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 内置选项 ...

    Instant Node.js Starter(英文)

    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 ...

    iPhone开发秘籍.part2.rar

    应用程序进行了细化的分类,并指导你构建第一个Hello World 样式的示例。 第2章:视图 第2章介绍屏幕上的iPhone 视图及对象。你将了解如何对视图进行布置、创建和排序,以创建iPhone 应用程序的骨架。还会了解视图...

    Spring MVC简介_动力节点Java学院整理

    Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面。今天先从写一个Spring MVC的HelloWorld开始,让我们看看如何搭建起一个Spring mvc的环境并运行程序,感兴趣的朋友一起学习吧

    java乒乓球源码-suraj-kumar.github.io:suraj-kumar.github.io

    Hello World 是在我 14 岁的时候,现在我可以用 C、C++、Java、Javascript、python、visual basic、C# 编写它,并且还在学习新的编写方法。 当我不编码时,您会发现我在打羽毛球、乒乓球、卡罗姆和国际象棋。 我喝了...

    iPhone开发秘籍

    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 开发电话 ...

    iPhone开发秘籍.part4.rar

    应用程序进行了细化的分类,并指导你构建第一个Hello World 样式的示例。 第2章:视图 第2章介绍屏幕上的iPhone 视图及对象。你将了解如何对视图进行布置、创建和排序,以创建iPhone 应用程序的骨架。还会了解视图...

    iPhone开发秘籍.part1.rar

    应用程序进行了细化的分类,并指导你构建第一个Hello World 样式的示例。 第2章:视图 第2章介绍屏幕上的iPhone 视图及对象。你将了解如何对视图进行布置、创建和排序,以创建iPhone 应用程序的骨架。还会了解视图...

    Ajax完全自学手册(源代码).rar

    HelloWorld 第一个Ajax应用程序 第2章 浏览器中的JavaScript Test4Navigator.htm User-Agent检测法 Test4Window1.htm window对象属性 test4Alert.htm 系统对话框 Test4Timeout.htm 时间间隔和暂停 Test...

    C# 7.1 and .NET Core 2.0 – Modern Cross-Platform Development – Third Edition

    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 ...

    Ajax完全自学手册PPT和源代码(ptt格式)

    HelloWorld 第一个Ajax应用程序 第2章 浏览器中的JavaScript Test4Navigator.htm User-Agent检测法 Test4Window1.htm window对象属性 test4Alert.htm 系统对话框 Test4Timeout.htm 时间间隔和暂停 Test4History....

Global site tag (gtag.js) - Google Analytics