The upgrade path from WebWork 2 to Struts 2 is smooth glide. Here's the roadmap.
System Platform
- Struts 2 is dependant on XWork 2 (beta-1).
- Java 1.5 is required to build Struts 2.
- For Java 1.4 deployments, RetroTranslater JARS are available with the distribution.
For other changes from WebWork 2, see the "Members to rename", "New property settings", "New features or feature changes", and "Removed or deprecated" sections.
Members to rename
WebWork 2 Struts 2
com.opensymphony.xwork.* | com.opensymphony.xwork2.* |
com.opensymphony.webwork.* | org.apache.struts2.* |
xwork.xml | struts.xml |
webwork.properties | struts.properties |
DispatcherUtil | Dispatcher |
com.opensymphony.webwork.config.Configuration | org.apache.struts2.config.Settings |
The tag prefix conventions in the example applications have changed.
JSP s: | <s:form ...> |
Freemarker s. | <@s.form ...> |
Velocity s | #sform ( ... ) |
New property settings
struts.enable.DynamicMethodInvocation Enable support for the hardwired action!alias syntax (Default is TRUE) |
| It is recommended that all applications specify the DynamicMethodInvocation setting for now, since the default may change. The recommended approach to action aliasing is to use wildcard aliases instead of the hardwired bang. |
New features and feature changes
- Various changes to ConfigurationManager
- ConfigurationManager is no longer a static factory. It is now an instance created through Dispatcher. Custom configuration could be done through DispatcherListener.
- Custom configuration to ConfigurationManager and Configuration cannot be done statically anymore, instead use Dispatcher's DispatcherListener to achieve the same effect.
- The prepare interceptor now uses reflection to call prepare_Method_ where method is the action method configured for the particular action in struts.xml.
<action name="myAction" method="insert" ....> ..... </action> 1] prepareInsert() (If it exists) 2] prepare() (Unless Interceptor's alwaysInvokePrepare parameter is set to false) 3] insert()
- DefaultWorkflowInterceptor (named workflow in struts-default.xml) now uses reflection to call validateMethod on the action class that implements Validateable interface where method is the action method configured for the particular action in struts.xml.
<action name="myAction" method="insert" ...> ... </action> 1] validateInsert() 2] validate() (unless Interceptor's alwaysInvokeValidate parameter is set to false) 3] insert()
- The tooltip library used by the xhtml theme was replaced by Dojo's tooltip component.
- Datepicker tag has been renamed to datetimepicker and is now using dojo (limited in terms functionality and internationalization)
- Tiles integration plugin is available.
- Wildcards can be specified in action mappings.
- MessageStoreInterceptor is introduced to allow field errors / action errors and messages to be store and retrieve through session, resulting them to be preservable across request.
Removed or deprecated
AroundInterceptor The AroundInterceptor has been removed. If your application extends the AroundInterceptor, either import the class into your source code form WebWork 2 (pursuant to the Open Symphony License) and modify it to server as your own base class, or rewrite your interceptor. |
oldSyntax Support for the "oldSyntax" is removed. |
Rich text editor tag Rich text editor tag is removed and replaced by Dojo's rich text editor |
doActionMethod The convention of trying a "do" form of an action method is not supported. <action name="..." method="submit"> ... </action> In WebWork, - try to execute submit method in the action, fail
- try to execute doSubmit method in the action if Step 1, fail
- fail
In Struts, - try to execute submit method in the action, fail
- fail
|
default method Calling the "default" method via "doDefault" is not supported. |
IOC framework Deprecated in WebWork 2.2, the internal IOC framework is removed in Struts 2. Spring is the ObjectFactory default. |
分享到:
相关推荐
WebWork2是一款基于Java的轻量级Web应用框架,它为开发者提供了强大的MVC(Model-View-Controller)架构支持,使得构建动态、数据驱动的Web应用变得更加简单和高效。这款框架在2000年代中期较为流行,是Struts的一个...
WebWork2是一个基于Java的轻量级Web应用框架,它为开发者提供了构建高效、可维护的Web应用程序的强大工具。在本教程中,我们将深入探讨WebWork2的核心概念、功能及其在实际开发中的应用。 WebWork2是Struts的前身,...
根据提供的文件信息,我们可以推断出这是一篇关于Java私塾中的Spring框架讲解与WebWork2整合教程的文章。下面将围绕这些关键词展开详细的讲解。 ### Spring框架基础 #### Spring简介 Spring是一个开源框架,最初由...
WebWork2是一款基于Java的轻量级MVC(Model-View-Controller)框架,它在Web应用程序开发中起到了核心架构的作用。WebWork2是Struts的替代品,它提供了更强大的功能、更好的性能以及更优雅的API。在这个“WebWork2...
WebWork2是一款基于Java的MVC(Model-View-Controller)框架,用于构建Web应用程序。在Web开发领域,它提供了一种结构化和模块化的开发方式,帮助开发者更高效地组织代码并实现业务逻辑。本指南将深入探讨WebWork2的...
WebWork2是一款基于Java的开源MVC(Model-View-Controller)框架,它为构建企业级Web应用程序提供了强大的支持。这个“webwork2官方文档中文版”是针对开发者的重要参考资料,帮助他们理解和掌握WebWork2的核心概念...
Webwork2是一个基于Java的MVC(模型-视图-控制器)框架,它在Web应用程序开发中提供了一种组织和管理代码的方式。以下是对Webwork2框架的学习总结: 1. **JAR包下载与项目配置**: - 开始学习Webwork2时,首先需要...
**Webwork2 开发指南** Webwork2 是一个基于Java的开源MVC(Model-View-Controller)框架,专门用于构建动态、交互式的Web应用程序。它提供了强大的数据绑定、动作控制、异常处理以及国际化等功能,使得开发者能够...
在探讨Struts2与WebWork2的联系与区别的过程中,我们不得不提到它们的历史渊源以及在Java Web开发领域中的地位。Struts2框架实际上可以视为WebWork2框架的继承者,两者之间的关系紧密而复杂,下面将从多个角度深入...
WebWork2是一个基于Java的开源MVC(Model-View-Controller)框架,用于构建Web应用程序。这个框架的设计理念是将业务逻辑、数据模型和用户界面有效地分离,从而提高开发效率和代码可维护性。WebWork2中文文档是针对...
Webwork2的教程
Webwork2是一款基于Java的开源框架,主要用于构建企业级的Web应用程序。这个框架以其强大的MVC(模型-视图-控制器)架构而闻名,能够帮助开发者实现高效、可维护的代码结构。OpenDoc出品的"Webwork2开发指南.pdf"是...
Webwork2是一个基于Java的开源框架,主要用于构建动态、交互式的Web应用程序。它以其强大的MVC(模型-视图-控制器)架构而闻名,能够帮助开发者有效地组织代码,提高开发效率,同时保持良好的可维护性和扩展性。...
Struts2、Webwork2 和 DWR 是三个在 Web 开发领域中至关重要的技术,尤其在构建企业级的 WEB2.0 应用程序时。接下来,我们将详细探讨这三个技术的核心概念、工作原理以及它们之间的关系。 **Struts2** 是一个基于 ...
webwork2中文参考
Webwork2 是一个开源的在线作业系统,专为教育领域设计,用于创建和管理数学、物理等科学科目的互动问题。这个系统的核心是基于Java的,它允许教师创建复杂的数学问题,学生则可以在浏览器中解答并立即得到反馈。...
### WebWork2 教程详解 #### 一、引言 WebWork2 是一款轻量级的 Java Web 开发框架,它遵循 MVC (Model-View-Controller) 设计模式,旨在简化 Web 应用程序的开发流程。通过本文档的学习,您将能够掌握 WebWork2 ...
WebWork2是一个基于Java的MVC(模型-视图-控制器)框架,它在早期的J2EE开发中被广泛使用。本实例源代码提供了深入理解WebWork2工作原理和应用开发的机会。以下是对WebWork2核心知识点的详细阐述: 1. **MVC架构**...
Webwork2是一个基于Java的轻量级Web应用框架,它为开发者提供了构建MVC(Model-View-Controller)架构的应用程序的强大工具。本教程“Webwork2-Guide”旨在指导用户理解和掌握Webwork2框架的核心概念和技术。让我们...