JSP/Servlet:JSF相对于Struts的一些优点
JSF跟Struts的优劣之争已经好久了。相对于Struts,本人更看好JSF,以下是转自exadel的一篇文。
Top Ten Reasons to Prefer JSF over Struts
I've got a client who's trying to decide whether to use Struts or JSF. As you might expect, I'm often asked, especially at NFJS symposiums, what the differences are between the two frameworks. And, of course, my client's not alone; quite a few folks are trying to decide which framework to select.
In general, my advice is to prefer JSF for new projects. There are sometimes compelling business reasons to stay on the Struts path for existing projects and those situations usually call for some close analysis, but let's face it: JSF is much better than Struts.
So, without further ado, here's my top-10 list of reasons to prefer JSF to Struts...
Top Ten Reasons to Prefer JSF to Struts
- Components
- Render Kits
- Renderers
- Value Binding Expressions
- Event Model
- Extensibility
- Managed Beans (Dependency Injection)
- POJO Action Methods
- JSF is the standard Java-based web app framework
- There's only one Struts
#10: There's only one Struts
Struts is an open-source product, whereas JSF is a specification. That's a subtle distinction, which is often lost on JSF newcomers, but it's significant because we can have numerous JSF implementations. As young as JSF is, we already have two excellent JSF implementations to choose from: the Reference Implementation from Sun and MyFaces, from Apache. On the other hand, there's only one Struts.
#9: JSF is the standard
JEE 5.0 containers must provide an implementation of JSF, which means that JSF will soon be ubiquitous. That might not matter to you, but it matters to tool vendors. With approximately 50 Java-based web app frameworks, tool vendors have been reluctant to support a particular framework, but a standard is something tool vendors can, and have, rally(ied) behind. But it's not just vendors: open source projects are rallying around JSF with such dizzying speed that they're stepping over one another to implement the same features. For example, I hadn't even heard of Facelets until we were done implementing essentially the same functionality with Shale's Tapestry-like views. 
相关新闻>>
- 发表评论
-
- 最新评论 更多>>