webflow1.06升级到2.4.4
来源:互联网 发布:sql删除某列数据 编辑:程序博客网 时间:2024/05/22 16:39
因项目原因,spring从2.4直接升级的4.2.2,由于webflow和spring之间存在着关联,webflow也面临着需要升级。网络上关于webflow的资料少,能看懂的资料更少,升级的资料更是只找到一篇。在同事们的大力支持下,完成了升级,先感谢各位同事的鼎力相助。
1.替换新的jar包
2.配置文件
2.1webflow的XML头文件的变动
http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd 改为 http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd
把1.0该为2.0,而不是改为2.4,时间原因,没有测试改为2.4会有什么结果,后续会补上。
2.2 与spring配置文件结合
1.0 相关的配置
<bean id="xxxxxxxxxxxxxxxxxxxxxxB"class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"><property name="mappings"><props><prop key="/login">xxxController</prop></props></property><property name="interceptors"><list><ref bean="localeChangeInterceptor" /></list></property></bean><bean id="xxxController"class="org.springframework.webflow.executor.mvc.FlowController"p:flowExecutor-ref="flowExecutor" p:defaultFlowId="login-webflow"><property name="argumentHandler"><beanclass="org.springframework.webflow.executor.support.RequestParameterFlowExecutorArgumentHandler"p:flowExecutionKeyArgumentName="lt" p:defaultFlowId="login-webflow" /></property></bean><flow:executor id="flowExecutor" registry-ref="flowRegistry"><flow:execution-attributes><flow:alwaysRedirectOnPause value="false" /></flow:execution-attributes></flow:executor><flow:registry id="flowRegistry"><flow:location path="/WEB-INF/login-webflow.xml" /></flow:registry>2.4相关配置
<bean id="viewResolver"class="org.springframework.web.servlet.view.ResourceBundleViewResolver"p:order="0"><property name="basenames"><list><value>${xxx.viewResolver.basename}</value><value>xxxxx_views</value></list></property></bean> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /><!-- webflow配置 --> <bean name="flowController" class="org.springframework.webflow.mvc.servlet.FlowController"> <property name="flowExecutor" ref="flowExecutor"/> </bean> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/login.do">flowController</prop> </props> </property> </bean> <webflow:flow-executor id="flowExecutor" /> <webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices"> <webflow:flow-location path="/WEB-INF/login-webflow.xml" id="login" /> </webflow:flow-registry> <webflow:flow-builder-services id="flowBuilderServices" view-factory-creator="mvcViewFactoryCreator" /> <bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator"> <property name="viewResolvers" ref="viewResolver" /> </bean>
2.3webflow的XML
在2.0的配置中,删除掉了<start-state idref="initialFlowSetup" />
<action-state>标签:把1.0的
<action-state id="initialFlowSetup"><action bean="initialFlowSetupAction" /><transition on="submit" to="submit" /></action-state>
改为了
<action-state id="initialFlowSetup"><evaluate expression="initialFlowSetupAction"/><transition on="submit"to="submit" /></action-state>
把action标签改为了evaluate表达式的方式。在网络上也看到有这种配置:initialFlowSetupAction.doExecute(flowRequestContext),其中flowRequestContext必须这么写,也不需要配置什么但是项目不知道何种原因,使用了这种配置,项目报错,找不到doExecute方法,只好放弃,直接使用initalflowsetupaction这种配置方法。
注意使用1.0配置需要自己去要配置initialFlowSetupAction的bean。
<view-state>标签:
把1.0的
<view-state id="viewLoginForm" view="casLoginView"><render-actions><action bean="authenticationViaFormAction"method="setupForm" /><action bean="authenticationViaFormAction"method="referenceData" /></render-actions><transition on="submit" to="bindAndValidate" /></view-state>改为2.0的
<view-state id="viewLoginForm" view="casLoginView"><on-render><evaluate expression="authenticationViaFormAction.setupForm(flowRequestContext)" /><evaluate expression="authenticationViaFormAction.referenceData(flowRequestContext)" /></on-render><transition on="submit" to="bindAndValidate" /></view-state>
其他标签均未改动。
需要主要的是flowRequestContext引用的是:org.springframework.webflow.execution.RequestContext
Event 引用的是org.springframework.webflow.execution.Event
submit方法:public final Event submit(final RequestContext context)
有什么不足之处,及时指出
阅读全文
3 0
- webflow1.06升级到2.4.4
- Python升级2.4到2.7
- Apache2.2升级到2.4
- php5.4升级到php7
- 升级ambari、HDP版本(ambari 2.1升级到2.4、HDP2.3升级到2.5)
- Bugfree升级(从2.0升级到3.0.4)
- 平台2.3升级到2.4的问题
- 虚拟机2.4内核升级到2.6
- 2.4升级到2.5的问题
- centos 5.8升级python 2.4到2.7
- Redis 2.2.* 到 2.4.*升级方案
- python 2.4 升级到2.6方法
- wince .net2.06升级到2.07
- php升级到4出现的问题
- 今天把php升级到5.1.4
- MySQL 4到5的快速升级
- linux2.4内核升级到linux2.6
- Eclipse升级到V3.4--Ganymede
- Lua语法小贴士(十五)upvalue
- RabbitMQ的安装,配置,监控
- Dubbo分布式,微服务架构解决方案,jvm虚拟机,Redis持久化
- 代码函数调用关系图
- 移动运营商订制短信卡片无法点击
- webflow1.06升级到2.4.4
- js中获取键盘事件
- [CMake] 第三方库使用示例
- 树——二叉树的序列化和反序列化
- MySQL5.5.27安装教程
- genymotion INSTALL_FAILED_NO_MATCHING_ABIS错误
- Boost智能指针学习
- 升级Cmake
- OpenCVForUnity 透视校正,透视变换