`
yangzb
  • 浏览: 3470671 次
  • 性别: 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程序时,一定要熟悉smsh框架结构和W3C网页标准,本书涵盖这些知识,《Hibernate3.6.10-Final-API规范手册》《Hibernate3.6.10-Final-官方中文参考手册》《JAVA-JDK1.6-API规范手册》《JAVA主流开源框架...

    INACTIVE: Java Web Application Framework-开源

    Java Web应用程序框架(JWAF)是旨在扩展现有的每层框架(例如Struts和Castor)的框架,以提供用于快速构建业务流程应用程序的完整框架。 还考虑SF项目ValueObjects。

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

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

    pulse - Java web app framework / CMS:专为企业级和高度定制的网站而打造-开源

    Java的开源门户解决方案。 Pulse是Servlet API之上的框架,提供了易于使用和易于扩展的模式,用于创建基于浏览器的应用程序和网站。 此外,pulse提供了一组现成的组件,例如CMS,购物,用户管理。 主要特征:-跨平台...

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

    Nicholas S. Williams是Java和相关技术领域的一位著名专家。...Nick大量参与了开源社区工作,为Apache Log4J、Apache Tomcat、Jackon Mapper、Spring Framework和Spring Security等项目贡献了bug修复、新特性和文档。

    Java Web Application Framework-开源

    Java Web应用程序框架。 使用设计器和框架服务,可以在最短的时间内轻松编写外观好,样式丰富,防黑客,行为良好,可自定义,内容丰富的Java Web应用程序。

    Spring Framework 6.0 是一个开源的Java EE全功能栈(full-stack)的应用程序框架.rar

    Spring Framework 是一个开源的Java/Java EE全功能栈(full-stack)的应用程序框架,以Apache License 2.0开源许可协议的形式发布,也有.NET平台上的移植版本。该框架基于 Expert One-on-One Java EE Design and ...

    开源bbs源码java-jeeweb:知乎

    java JeeWeb敏捷开发平台 QQ交流群: 570062301(满)、522959928 官方网站: 文档地址: 项目演示: 前后端分离版本项目演示: 分离开发前端项目地址: 简介 JeeWeb是一款基于SpringBoot 2+Spring+Mybatis+...

    ItsNat, Natural AJAX Java Web Framework-开源

    itsNat是基于组件的AJAX Java Web应用程序框架。无需XML编程,无需混合视图/代码,无需自定义JavaScript。只有纯HTML,纯Java和以服务器为中心的W3C标准的类似Swing的编程,其中“浏览器就是服务器”

    Visual Web Developer(可视化Web开发工具)(rar)

    WebFramework内置Log4j,Hibernate,DWR,cache等开源技术。 并且实现常用部分功能,如用户登录注册,用户角色与权限,系统模块管理,资源管理,文件上传与下载等。 可以跨操作系统,跨数据库(您不再需要关心数据库的...

    Think in Java - JavAjax Web Framework-开源

    JavAjax现在是1.4 beta版,有关下载和文档,请访问http://www.javajax.org

    开源bbs源码java-Jweb:播放器

    java JeeWeb敏捷开发平台(Mybatis) QQ交流群: 570062301 官方网站: 官方论坛: 项目演示: Hibernate版本: 简介 JeeWeb Mybatis版本是一款基于SpringMVC+Spring+Mybatis+Mybatis Plus的敏捷开发系统;它是一款...

    webframework:该存储库主要用于存储开源代码和项目代码

    网络框架 该存储库主要用于存储开源代码和项目代码

    Java开源

    Apache Axis 是Apache WebService项目中的子项目,其最初起源于IBM的"SOAP4J",应该属于最早的一批用于构造基于SOAP应用的Framework。 目前Apache Axis已经发展到了第三代,其核心是一个SOAP处理器,用于开发包括...

    Spring Framework 开源JAVA开发框架 v5.1.5

    Spring Framework 是一个开源的Java/Java EE全功能栈(full-stack)的应用程序框架,以Apache许可证形式发布,也有.NET平台上的移植版本。 该框架基于 Expert One-on-One Java EE Design and Development(ISB

    开源bbs源码java-jeeweb2:jeeweb2

    java JeeWeb敏捷开发平台 QQ交流群: 570062301(满)、522959928 官方网站: 文档地址: 项目演示: 前后端分离版本项目演示: 分离开发前端项目地址: 简介 JeeWeb是一款基于SpringBoot 2+Spring+Mybatis+...

    Java全栈Web开发框架NinjaWeb.zip

     web\/framework \/ \/Ninja Web 是 Java 全栈 Web 开发框架,非常稳固、快速和高效。Ninja 对开发大型企业应用和 RESTful JSON 微服务非常有用,可以一次性提供所有生产环境所需:开发,测试,部署,重构和维护...

    Waffle Web Framework-开源

    Waffle是一个Java Web框架,允许基于pojo的操作。 内置了依赖性注入支持。Waffle没有专有的模板语言,也不需要任何XML配置文件。 华夫饼应用程序易于编写和测试。

    borg9 J2EE/ Java Web-App Framework-开源

    borg9 库是一组对典型的 j2ee web 应用程序有用的实用程序。

    轻量级JavaWeb框架Fast-FrameWork.zip

    轻量级 Java Web 框架 基于 JDK 8 规范 基于 Servlet 3.0 规范 零配置 REST 服务接口 基于 JSON 传输 目前提供 MVC ... 解决方案 ...

Global site tag (gtag.js) - Google Analytics