`
yangzb
  • 浏览: 3502064 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Java的开源Web Framework简介

阅读更多

from :http://www.cjsdn.net/post/view?bid=20&id=127871&sty=3&age=0

Cocoon - 基于XML的Web内容发布
Cocoon是采用100%纯Java编写的一个内容发布框架。Cocoon让你能采用W3C的最新技术(DOM、XML、XSL)来提供Web内容。
新的Cocoon模式能将文档内容、样式、处理逻辑进行完全的分离,允许这三层能独立地设计、创建和管理,从而减少了管理开销,加强了工作的重用性,减少了开发时间。
下载地址:http://xml.apache.org/cocoon

Xang - 快速开发动态网页
Xang能整合不同的数据源,让你能快速地开发数据驱动的、跨平台的Web应用。Xang体系结构能将数据、逻辑和表示完全划清。Xang基于开放的工业标准,例如HTTP、XML、XSL、DOM、ECMAScript(JavaScrip)。
下载地址:http://xml.apache.org/xang

Slide - 内容管理框架
Slide是一个内容管理和集成系统,是一个内容管理底层框架。Slide提供了一个分级的结构,能将内容存储到任意的、分布式的数据仓库。出此之外,Slide还集成了安全、锁定、内容版本和其他一些服务。
下载地址:http://jakarta.apache.org/slide

Struts - 基于MVC设计模式的JSP
Struts是采用Java Servlet/JavaServer Pages技术,开发Web应用程序的开放源码的framework。
采用Struts能开发出基于MVC(Model-View-Controller)设计模式的应用构架。
Struts有如下的主要功能:
1. 包含一个controller servlet,能将用户的请求发送到相应的Action对象。
2. JSP自由tag库,并且在controller servlet中提供关联支持,帮助开发员创建交互式表单应用。
3. 提供了一系列实用对象:XML处理、通过Java reflection APIs自动处理JavaBeans属性、国际化的提示和消息。
下载地址:http://jakarta.apache.org/struts

Jetspeed - 基于Web的组件
Jetspeed 是实现了Enterprise Information Portal的开源软件。Jetspeed能从Internet的纵多资源中提取信息,来帮助用户管理大量的数据。这些信息能来自不同的内容类型,从 XML到XMTP,到iCalendar这些新协议。
下载地址:http://java.apache.org/jetspeed

Turbine - 基于Servlet的Web应用开发
Turbine是基于servlet的framework,使有经验的Java开发员能快速地构建web应用。
使用Turbine,可以通过创建使用特定服务来处理模板的Screen,来集成现有的模板技术(例如Velocity、Webmacro、Java Server Pages(JSP)、FreeMarker、Cocoon)。
下载地址:http://java.apache.org/turbine

各种Framework比较

在这些framework中,Cocoon、Struts和Turbine比较好。这三者各有所长,Cocoon是最好的XML Framework,Struts是最好的JSP Framework,Turbine是最好的Servlet Framework。

Matt Raible 写的Comparing Web Frameworks:
Matt Raible 是《Spring Live》一书的作者

Struts

. 优点
. The “Standard” - lots of Struts jobs
. Lots of information and examples
. HTML tag library is one of the best

. 缺点
. ActionForms - they’re a pain
. Can’t unit test - StrutsTestCase only does integration
. Mailing list volume is overwhelming

Spring MVC

. 优点:
. Lifecyle for overriding binding, validation, etc.
. Integrates with many view options seamlessly: JSP/JSTL,
Tiles, Velocity, FreeMarker, Excel, XSL, PDF
. Inversion of Control makes it easy to test

. 缺点:
. Not many using it
. Requires writing lots of code in JSPs
. Almost too flexible - no common parent Controller

WebWork

. 优点:
. Simple architecture - easy to extend
. Tag Library is easy to customize - backed by Velocity
. Interceptors are pretty slick

. 缺点:
. Documentation only recently written, few examples
. Client-side validation immature

Tapestry

. 优点:
. Very productive once you learn it
. Templates are HTML - great for designers
. Healthy and smart user community

. 缺点:
. Documentation very conceptual, rather than pragmatic
. Steep learning curve - very few examples
. Impossible to test - page classes are abstract

JSF

. 优点:
. J2EE Standard - lots of demand and jobs
. Fast and easy to develop with
. Rich Navigation framework

. 缺点:
. Tag soup for JSPs
. Immature technology - doesn’t come with everything
. No single source for implementation

Controllers and Views
. Struts: UserAction extends DispatchAction
. Spring MVC: UserFormController extends
SimpleFormController
. WebWork: UserAction extends ActionSupport
. Tapestry: UserForm extends BasePage
. JSF: UserForm

List Screens
. How easy is it to integrate a sortable/
pageable list of data?
. Struts, Spring MVC and WebWork can all
use Tag Libraries like the Display Tag
. Tapestry has a contrib:Table component
. JSF has a dataTable with no sorting - have
to write your own logic if you want it

Bookmarking and URLs
. Using container-managed authentication (or other filterbased
security systems) allow users to bookmark pages.
They can click the bookmark, login and go directly to the
page.
. WebWork has namespaces - makes it easy
. Struts and Spring allow full URL control
. Tapestry has ugly URLs - difficult to segment the app for
different roles
. JSF does a POST for everything

Validation
. Validation should be easy to configure, be robust on the
client side and either provide good out of the box messages
or allow you to easily customize them.
. Struts and Spring MVC use Commons Validator - a
mature solution
. WebWork uses OGNL for powerful expressions -
client-side support very new
. Tapestry has very robust validation - good messages
without need to customize
. JSF - ugly default messages, but easiest to configure

Testability
. Struts - can use StrutsTestCase
. Spring and WebWork allow easy testing with
mocks (i.e. EasyMock, jMock, Spring Mocks)
. Tapestry is impossible to test because page classes
are abstract
. JSF page classes can be easily tested and actually
look a lot like WebWork actions

Success Messages
. The duplicate-post problem, what is it?
. Easiest way to solve: redirect after POST
. Struts is the only framework that allows success
messages to live through a redirect
. Spring and WebWork require custom solutions
. Tapestry requires you to throw an Exception to redirect
. JSF requires a custom solution, i18n messages difficult to
get in page beans

Spring Integration
. All frameworks have integration with Spring
. Struts: ContextLoaderPlugin and Base classes
. WebWork: SpringObjectFactory
. Tapestry: override base engine, grab from servlet
context, put into global map
. JSF: DelegateVariableResolver or JSF-Spring Library

Internationalization
. JSTL’s tag makes it easy
. No standard for getting i18n messages in
controller classes
. Struts, Spring and JSF encourage one
ResourceBundle per locale
. WebWork and Tapestry advocate separate
files for each page/action

Page Decoration
. Used Tiles since it first came out in 2001
. SiteMesh is much easier to setup and use
. Tiles can be used in Struts, Spring and JSF
. Requires configuration for each page
. SiteMesh can be used with all frameworks
. Requires very little maintenance after
setup

Tools
. Struts has a lot of IDE support and even has
frameworks built on top of it (i.e. Beehive’s
PageFlow)
. Spring has Spring IDE - only does XML validation,
not a UI/web tool
. WebWork has none
. Tapestry has Spindle - great for coders
. JSF has many, all cost money and hook into
proprietary app servers

Business/Marketing
. Struts is still in high-demand and widely-used
. Spring is getting more press, but mostly due to the
framework’s other features
. WebWork is gaining ground, but pretty scarce on
job boards
. Tapestry is even more scarce - needs more
marketing
. JSF is quickly becoming popular

My Opinion //Matt Raible 建议
. Struts is fast to develop with because most problems have
been solved. HTML tag library the best of the bunch.
. Spring is nice, but lack of form tags drops it down a notch
or two. JSP 2.0 tag files exist in issue tracker.
. I like WebWork a lot, but lack of of good client-side
validation support is a killer.
. Tapestry - I haven’t finished the learning curve.
. JSF - needs to listen to developers to see what they want
instead of tools vendors.

Which would I choose?
. Quick and dirty project?
. Struts because I know it best
. Massive enterprise project?
. Tapestry for its reusable components
. If I got a job as an open source developer?
. WebWork because using it requires you to dig into the frameworks

Resources //资源
. Download sample apps for this presentation
. http://equinox.dev.java.net/framework-comparison
. Struts - http://struts.apache.org
. StrutsTestCase: http://strutstestcase.sf.net
. Spring MVC - http://www.springframework.org
. Spring IDE: http://www.springframework.org/spring-ide/eclipse
. WebWork - http://opensymphony.org/webwork
. Eclipse Plugin: http://sf.net/projects/eclipsework
. IDEA Plugin: http://wiki.opensymphony.com/display/WW/IDEA+Plugin
. Tapestry - http://jakarta.apache.org/tapestry
. Spindle: http://spindle.sourceforge.net
. JSF - http://java.sun.com/j2ee/javaserverfaces and http:// myfaces.org
. Java Studio Creator: http://sun.com/software/products/jscreator
. MyEclipse: http://myeclipseide.com
. IDEA: http://www.jetbrains.com/idea
. SiteMesh: http://opensymphony.com/sitemesh
. Testing Frameworks
. JUnit: http://junit.org
. EasyMock: http://easymock.org
. jMock: http://jmock.org
. jWebUnit: http://jwebunit.sourceforge.net
. Canoo WebTest: http://webtest.canoo.com
. XDoclet - http://xdoclet.sourceforge.net
. AppFuse - http://appfuse.dev.java.net //强烈推荐学习这个东西,集成了很多的开源技术

Books //参考书籍
. Struts in Action, Ted Husted and Team
. Struts Live, Rick Hightower and Jonathan Lehr
. Spring Live, Matt Raible
. Spring in Action, Craig Walls and Ryan Breidenbach
. Professional Java Development with Spring, Rod
Johnson, Juergen Hoeller and Team
. WebWork in Action, Patrick Lightbody and Team
. Tapestry in Action, Howard Lewis Ship
. Core JSF, David Geary and Cay Horstmann
. JSF in Action, Kito Mann

The End //结束
...or is it just the beginning...

分享到:
评论

相关推荐

    java开源web项目3

    【Java开源Web项目3详解】 Java作为一门广泛应用于企业级应用开发的语言,其在Web开发领域有着深厚的根基。开源Web项目3是基于Java技术栈构建的,它利用了Java的强大功能和灵活性,为开发者提供了丰富的工具和框架...

    Java Web Framework综述

    本文将探讨Java Web Framework的基本工作原理以及一些常见的开源Web MVC框架。 首先,理解HTTP协议和Servlet规范对于Java Web开发至关重要。HTTP(超文本传输协议)是Web服务器与浏览器之间通信的基础,而Servlet...

    Java开源邮件服务器james源码

    Java开源邮件服务器Apache James是基于Java技术构建的一款强大的邮件服务器软件。它的源代码开放,允许开发者深入了解其工作原理,并可根据需求进行定制化开发。Apache James 2.3.2是该项目的某个稳定版本,提供了...

    Java开源项目资源列表.doc

    "Java开源项目资源列表" 本文档介绍了多个 Java 开源项目资源,涵盖了 Spring Framework、WebWork、Struts、Hibernate 和 Quartz 等多个框架和工具。 Spring Framework Spring Framework 是一个强大且灵活的 Java...

    Java Web高级编程 涵盖WebSockets、Spring Framework、JPA Hibernate和Spring Security

    Spring Framework是一个开源的Java平台,它最初是为了解决企业应用开发中的复杂性而设计的。Spring框架通过提供一系列的模块,如核心容器、数据访问/集成、Web、AOP(面向切面编程)、消息以及测试模块,支持开发者...

    Java最著名的开源项目

    这些著名的Java开源项目不仅代表了技术上的创新,也为开发者提供了丰富的工具和资源。通过学习和使用这些项目,不仅可以提高开发效率,还能促进整个Java社区的发展。随着技术的不断进步,相信未来还会有更多优秀的...

    JAVA主流开源框架

    开发服务器web程序时,一定要熟悉smsh框架结构和W3C网页标准,本书涵盖这些知识,《Hibernate3.6.10-Final-API规范手册》《Hibernate3.6.10-Final-官方中文参考手册》《JAVA-JDK1.6-API规范手册》《JAVA主流开源框架...

    java开源论坛(完整版+数据库)

    【标题】"java开源论坛(完整版+数据库)"所涉及的知识点主要集中在Java编程语言、开源社区、数据库管理和Web应用程序开发领域。这个项目提供了一个完整的论坛解决方案,包括前端用户界面和后端服务,以及配套的数据库...

    INACTIVE: Java Web Application Framework-开源

    Java Web应用程序框架(JWAF)是一个开源框架,它的设计目标是增强现有的Web应用开发框架,如Struts和Castor,以提供一个更全面、更高效的方法来构建业务流程驱动的应用程序。JWAF旨在简化Java Web应用的开发流程,...

    【开源】JAVA即时通讯 nothing to say 重出江湖篇

    标题中的“JAVA即时通讯 nothing to say 重出江湖篇”表明了这个开源项目是关于Java实现的即时通讯系统,可能是类似聊天应用或者消息传递平台。关键词“重出江湖篇”暗示了这可能是一个曾经存在过,现在进行了更新或...

    WebFramework:从零开始写java-web框架

    "WebFramework:从零开始写java-web框架"项目提供了一个学习和实践的机会,让我们深入理解Web开发背后的机制。这个开源项目的目标是帮助开发者从基础开始构建自己的Java Web框架,从而更好地掌握Web应用开发的核心...

    一些Github 上超实用的 Java 项目集合(开源项目集合)

    在Java开源项目中,我们可以找到各种类型的应用,包括但不限于Web框架(如Spring Boot、Spring MVC)、数据处理库(如Hibernate、MyBatis)、测试工具(JUnit、Mockito)、并发处理(Akka、Reactor)、日志系统(Log...

    java开源框架下载集合

    ### Java开源框架下载集合 在Java开发领域,开源框架的应用极大地提升了软件开发的效率与质量。本文将基于提供的部分开源框架资源,详细阐述这些框架的特点、功能及其在实际项目中的应用价值。 #### 1. Play ...

    Java 开源项目集合.zip

    《Java开源项目集合》 Java,作为世界上最受欢迎的编程语言之一,拥有丰富的开源项目资源,这些项目涵盖了各种领域,从Web开发、大数据处理到机器学习、云计算等。本压缩包"Java 开源项目集合.zip"汇聚了众多优秀的...

    Java开源 AJAX框架

    Java开源AJAX框架是开发Web应用时常用的工具,它们提供了便捷的方式来实现异步JavaScript和XML(AJAX)技术,从而提升用户体验,减少页面刷新。以下是一些流行的Java开源AJAX框架的详细介绍: 1. **DWR (Direct Web...

Global site tag (gtag.js) - Google Analytics