`

struts2学习笔记(2)--Struts 2.0 特性

阅读更多
struts2的一些新特性:

  • Improved design: In contrast with Struts 1, all of the Struts 2 classes are based on interfaces. Core interfaces are HTTP independent. These APIs are not dependent on Servlet APIs.
  • Simplified Actions: Struts 2 Action classes are framework independent and are simplified plain old Java objects (POJO). Any Java class with an execute() method can be used as an Action class.
  • POJO forms: Struts 2 does not support the ActionForms feature. The properties that are defined in the ActionForms can be put directly on the Action classes. You do not need to use all String properties.
  • Intelligent defaults: Most of the configuration elements in the Struts 2 configuration file will have default values, so there is no need to set values unless a different value is required. This helps reduce the configuration you need to do in the XML file. Struts 2's support for annotations helps make this even easier to achieve.
  • Enhanced results: In Struts 2, the >forward< tag is replaced by the <result> tags. Unlike ActionForwards, Struts 2 results help in preparing the response and provide flexibility to create multiple types of output.
  • Enhanced tags: Struts 2 tags don't just send output data, but also provide stylesheet-driven markup so that you can create consistent pages with less code. Struts 2 tags can now work with FreeMarker, Velocity, and similar template engines.
  • Introduction of interceptors: Struts 2 provides exhaustive support for interceptors. Interceptors can be executed before and after an Action class is executed. Interceptors are configured to apply common functionality, such as workflow or validation, to a request. All the requests pass through a set of interceptors before they are sent to an Action class. After the Action class is executed, the request passes through the interceptors again in the reverse order.
  • Ajax support: To create dynamic Web applications that use Ajax, Struts 2 provides an Ajax theme, which gives interactive applications a significant boost. Struts 2 tags for Ajax are based on Dojo widgets. Plug-ins are available for other frameworks as well.
  • QuickStart: Deployed configuration files are reloadable; hence, many changes can be made on the fly without the need to restart the Web container.
  • Stateful checkboxes: The Struts 2 framework automatically tracks checkboxes; if a checkbox is missing, the default value -- false -- is assumed. Hence, unlike in Struts 1, checkboxes do not require special handling for false values.
  • Easy testing: Struts 2 Actions are HTTP independent and thus framework neutral. They can be tested easily without using mock objects.
  • Use of annotations: Applications built using Struts 2 can use Java 5 annotations as an alternative to XML and Java properties configuration. Annotations minimize the need for XML. Annotations are available for Actions, interceptors, validation and type conversion.
  • Easy plug-in: Struts 2 extensions can be installed by dropping the plug-in JAR file into the \WEB-INF\lib directory. No manual configuration is required.
  • Easy integration with Spring: Struts 2 Actions are Spring-aware. Just adding Spring beans to an application will add Spring support.
  • Easily customized controllers: Struts 1 allows the request processor to be customized per module; in Struts 2, you can customize the request handling per action, if required.
2
1
分享到:
评论
2 楼 weidewei 2008-06-02  
Struts 2本来就是这么简单的.跟wenwork没有什么大区别.常用的基本都在这里面了.
1 楼 Ethip 2008-06-01  
如此简洁?

相关推荐

    struts2.0学习笔记1

    struts2.0学习笔记1 自己动手做的还算可以的 ]struts2.0学习笔记1 自己动手做的还算可以的struts2.0学习笔记1 自己动手做的还算可以的struts2.0学习笔记1 自己动手做的还算可以的

    Struts2.0学习笔记.doc

    Struts2.0学习笔记.doc,实例讲解

    struts2.0学习笔记,代码整理

    struts2.0学习笔记,代码演示,包括注释,大家互相学习,互相提高!

    struts2.0学习笔记

    总结了struts2.0的基本配置,是经验的总结!

    struts2.0实例源码

    struts2.0实例源码(struts2是我写的struts2Deom是我下的资源项目一起给大家) 包括strust2.0的所有知识面,每个点我都写了详细注释 网上是很难找到这样的资料的,这是我个人学习笔记拿出来希望跟大家一起学习...

    struts2学习笔记,总结了很多学习的经验

    struts2学习笔记,总结了很多学习的经验,标签的使用,action的使用。struts2.0 和 struts2.1 的区别

    struts2.0相关学习资料

    资料中含有struts2.0中文手册及其教程还有别人的学习笔记,整合了一下!好东西不能自己藏着,呵呵

    Struts2学习笔记

    学习Struts2的小笔记,及配置部署环境,dtd文件相关内容,部分文字有图示解释。

    Spring2.0学习笔记

    1、ICO环境的搭建 2、属性注入 3、自定义属性编辑器 4、AOP实现 5、事务处理 6、Spring事务配置的五种方式 详解 7、Struts与Spring集成方案

    struts笔记.rar

    Struts2.0笔记 精心整理后得出 希望对大家学习有帮助

    strust2.0学习笔记

    新型框架 目前还是比较流行的 建议学java的好好学学 很经典的

    Java/JavaEE 学习笔记

    Struts学习笔记...............263 Struts2.0..263 第一章 MVC Model.........................263 第二章 Struts Basic264 第三章 Action,Result & Struts2 Tag Library......................267 第四章 Data ...

    J2EE学习笔记(J2ee初学者必备手册)

    Struts学习笔记...............263 Struts2.0..263 第一章 MVC Model.........................263 第二章 Struts Basic264 第三章 Action,Result & Struts2 Tag Library......................267 第四章 Data ...

    SSH(Struts+spring+hibernate)整合资料

    java(1) 整合入门(spring,struts,hibernate的整合)资料(1) 中大软件工厂项目前培训资料(1) 完整笔记+源码(1) ssh(1) C#查询参数化例子(1) 学习笔记+完整源码(1) 介绍与深入(1) 学习笔记(不含整合)(1) C#(1) .CHM格式...

    JAVA API 说明.rar

    download-IntelliJ+IDEA+简体中文专题教程(电子版-2... JAVA_API_1.7中文 Java+EE+6+API+Specifications JavaAPIdoc_CN jQueryDocXML2CHM-090223 Struts2.0中文教程 maven学习笔记-霞客

    voa英语听力学习平台jsp版 v2.0.rar

    6、发布个人学习笔记,并对学习笔记进行维护;7、支付宝在线支付接口,实现在线购买服务功能;8、个人信息管理,个人界面方案维护;9、信息反馈及维护;10、JavaMail邮件发送功能实现。各功能模块的稳定性都经过了...

    AppFuse学习笔记(J2EE入门级框架)

    Appfuse是Matt Raible 开发的一个指导性的入门级J2EE框架,它对如何集成流行的Spring、Hibernate、iBatis、Struts、xDcolet、Junit、Taperstry、JSF等基础框架给出...AppFuse2.0重构了AppFuse1.0,转到Maven2和Jdk1.5。

Global site tag (gtag.js) - Google Analytics