Java Web layer framework comparison

Source: Internet
Author: User
Tags to domain

Author:It168 Qi Xiang2007-07-13

-- Compare JSF, spring MVC, Stripes, Struts 2, tapestry, and Wicket


This is a keynote speech by Matt raible at the Summer conference in JA-SIG, June 24 this year-27.
The web layer framework provides a comprehensive and in-depth comparison. The author believes that this document is a timely document, which has a great reference to how developers determine the quality of a Web-layer framework and how to choose a framework suitable for their own projects.
. This article is a summary of the speeches of Matt raible.
[Author] Matt
Raible, the initiator and main developer of the open-source framework appfuse; professional JSP 2.0, spring
Author of live and other books; conference speakers, MySQL user conference, apachecon, and apachecon
EU, and so on; now the CEO of raible designs.

First, with his practical experience, Matt points out the advantages and disadvantages of Java Web layer frameworks-JSF, spring MVC, Stripes, Struts 2, tapestry, and Wicket:
JSF
Advantages:
Java EE standard, which means there are great market demands and more job opportunities
Quick and easy to use
A large number of available Component Libraries
Disadvantages:
A large number of JSP labels
Poor Support for rest and security
There is no unified implementation. There are both sun implementation and Apache implementation-MyFaces.

Spring MVC
Advantages:
Provides lifecycle management for overriding binding and validation.
Seamless integration with many presentation layer technologies/frameworks: JSP/jstl, tiles, velocity, freemarker, Excel, XSL, PDF, etc.
Ease of test-thanks to IOC
Disadvantages:
A large number of xml configuration files
Too flexible-No public parent Controller
No built-in Ajax support for stripes
Advantages:
No need to write xml configuration files
Good Learning Documentation
Enthusiastic community members
Disadvantages:
Small community
Less active than other projects
The URLs in actionbean are hard-coded.

Struts 2
Advantages:
Simple architecture-easy to expand
The tag library can be easily customized using freemarker or velocity.
Controller-based or page-based navigation
Disadvantages:
Poorly organized documents
Excessive attention to new features
Most of the documents found by Google are struts 1. X.

Tapestry
Advantages:
Once learned, it will greatly increase productivity
HTML templates-good for page designers
Every time a new version is released, there will be a lot of innovation
Disadvantages:
The document is too conceptual and not practical enough.
Steep learning curve
Long release cycle-major upgrades every year

Wicket
Advantages:
Benefits for Java developers (not web developers)
Page and display are closely bound
Community activity-with support from creators
Disadvantages:
HTML templates are closely related to Java code
Need to have a good understanding of OO
Wicket logic-get everything done in Java. Next, Matt interviewed the authors of these frameworks to discuss various open-source Java Web frameworks with them, it also highlights the strengths of various frameworks and listens to the opinions of the Framework authors on other frameworks, hoping to learn about the future development direction of these frameworks.

The following are some interviewees:
JSF, Jacob hookom
Rife, Geert Bevin
Seam, Gavin king
Spring MVC, Rob harrop
Spring web flow, Rob harrop and Keith Donald
Stripes, Tim Fennell
Struts 1, Don Brown
Tapestry, Howard Lewis ship
Trails, Chris Nelson
Struts 2, Patrick lightbody
Wicket, eelco hillenius

Matt summarized the interview as follows:
JSF:
If you want a web application to have functionality similar to a desktop program, you can trust the JSF standard specifications and the support of a large number of third-party component libraries.
Spring MVC:
It integrates many different technologies, which can be widely used in different types of projects. It can be used as a basic platform for Web application development.
Stripes:
It can be applied to programs with a large number of complex data interactions; it has powerful type conversion, binding and verification functions; it makes it easy to manage large complex forms and map them directly to domain objects ......
Tapestry:
In medium to large projects, the performance is outstanding (of course, you can only apply it to a single page). In these projects, you can leverage it by simply creating new components.
Struts 2:
Generally, it is more suitable for small project teams who want to start their work and are willing to spend a lot of time learning the open-source tools they use. The goal of struts 2 is not the "armchairs programmers" who prefer drag-and-drop development ".
Wicket:
It is very suitable for internal/external network applications: the UI is very complex and you want to make full use of your developer resources.

The above summary highlights the strengths of each framework. However, what are their disadvantages? Matt proposed a standard for evaluating the quality of a framework:
Ajax support
Is it built-in? Is it easy to use?
Bookmarks
Can a user add a page to favorites and return it easily?
Verify
Is it easy to use? Is client (JavaScript) Verification supported?
Testability
Is it easy to leave the container test controller?
Submission and redirection
How does the framework handle repeated submissions?
Internationalization
How to support internationalization? Is it easy for controllers to use international information?
Page Modification
What type of page modification/composition mechanism does the framework support?
Community and technical support
Can a question be answered quickly and respectfully?
Development Tools
Is there any good tool that supports this framework, especially ide?
Market Demand
After learning this framework, can it help you find a job?
Number of positions
What are the requirements for this framework skill on dice.com and indeed.com? I think this evaluation standard is worth your reference.

Based on these evaluation criteria, Matt then elaborated on the frameworks as follows:
Ajax support
JSF: no built-in Ajax support. icefaces and ajax4jsf must be used.
Stripes: no corresponding class library. It supports stream output.
Struts 2: built-in dojo with plug-ins for GWT and JSON
Spring MVC: no corresponding class library. You need to use the DWR and spring MVC extensions.
Tapestry: In tapestry 4.1, there is a built-in dojo
Wicket: supported by dojo and script. aculo. Us

Bookmarks
JSF: You can submit it at will-URL is not even considered
Stripes: Use conventions, but you can ignore them.
Struts 2: Has a namespace concept, which makes it easy to add a page to favorites and return it.
Spring MVC: allow full URL Control
Tapestry: there are still some ugly URLs
Wicket: Mount page/URL

Verify
JSF: the default international information is ugly, but the configuration is simple.
Stripes and Wicket: Verify with Java class-client verification not supported
Struts 2: Use ognl to complete powerful expression verification. Client verification is supported only when rules are specified on the action.
Spring MVC: allows you to use public validators-a mature solution
Tapestry: robust verification feature-beautiful international information without customization

Testability
Spring MVC and Struts 2: allows the use of mocks (such as easymock, jmock, and spring MOCKS) for simple testing
Tapestry: difficult to test because the page class is abstract and the specific class is simplified.
JSF: The page class can be easily tested. In fact, it is similar to actions in struts 2.
Wicket: wickettester-a powerful solution
Stripes: Includes servlet API mocks and mockroundtrip

Submission and redirection
The easiest way to solve the repeated submission problem is to redirect after submission.
Spring MVC: allows you to add parameters to the Redirection URL.
Stripes, tapestry, and Wicket: Support for "Flash"
Struts 2: a custom solution is required.
JSF: a custom solution is required. It is difficult to add international information to the page bean.

Internationalization
The jstl <FMT: Message> label simplifies internationalization. There is no uniform standard for how to put internationalized information into the Controller class.
Stripes, spring MVC, and JSF: each region uses a resource binding file.
Struts 2, tapestry and Wicket: We advocate separating the resource files used by each page/action.
JSF: You need to define the resource binding information on each page.
Tapestry: <span key = "key. Name"> the tag is terrible.

Page Modification
Tiles can be used in struts 2, Spring MVC, and JSF. You need to configure each page.
Sitemesh can be used in all these frameworks (not recommended in JSF, tapestry, or wicket). After the configuration is complete, only a small amount of maintenance is required.

Development Tools
Spring MVC: Spring IDE, but only performs XML verification. It is not a UI/web tool.
Struts 2: Eclipse
Tapestry: spindle, which is very beneficial to the encoding staff
JSF: supports many IDES and is better and better.
Stripes and Wicket: no official tools
Netbeans currently supports struts *, JSF (+ facelets), tapestry, and Wicket. It does not yet support stripes and spring MVC.
Market Demand
Struts 1: it is still very demanding and widely used.
Spring MVC: more and more popular, but most of them are due to some other features of the Spring framework.
JSF: Quickly becoming popular
Struts 2: gaining ground, but there are few job opportunities
Tapestry: The popularity has increased over the past few years.
Wicket and stripes: Unknown

Through the comparison above, I think you should have a clearer understanding of which web layer framework should be selected in your project.

Finally, Matt lists some related resources for your reference.
Struts-http://struts.apache.org
Strutstestcase: http://strutstestcase.sf.net
Spring MVC-http://www.springframework.org
Spring ide: http://www.springide.org
Gaijin studio: http://gaijin-studio.sf.net
Struts 2-http://opensymphony.org/webwork
Eclipse Plugin: http://sf.net/projects/eclipsework
Idea Plugin: http://wiki.opensymphony.com/display/WW/IDEA+Plugin
Tapestry-http://tapestry.apache.org
Http://spindle.sourceforge.net
JSF-http://java.sun.com/j2ee/javaserverfaces and http://myfaces.apache.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
Tapestry test assist: http://howardlewisship.com/blog/2004/05/tapestry-test-assist.html
Appfuse-http://appfuse.org

At the end of the speech, Matt said, "if it works, use it !" The end is brilliant!

Through this article, we believe that you can open up the "fog" on the current Java Web layer framework selection, see "moon.
For the original speech, see http://raibledesigns.com/rd/entry/ja_sig_comparing_java_web.

 

From: http://tech.it168.com/j/n/2007-07-13/200707131036390_5.shtml

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.