JSF的采用和普及 [英] JSF Adoption and Popularity

查看:117
本文介绍了JSF的采用和普及的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是一个一般性问题,可以公开讨论...

Just a general question, open for discussion...

到目前为止,我非常喜欢JSF,虽然我是新手,但与Struts相比,我更喜欢它.从专业人士的角度来看,您是否认为JSF的前途光明?作为年轻的程序员,通过Struts或其他类似框架学习JSF 2.0是否值得投资?我应该坚持常规的JSP吗?通过JQuery,Ajax是否真的比JSF更简单?

I'm very much liking JSF so far, I'm new to it, but I prefer it to Struts. From a professionals standpoint, do you see a strong future for JSF ? Is it worth an investment as a young programmer to learn JSF 2.0 over Struts or another similar framework ? Should I stick to regular JSP ? Is Ajax really simpler through JQuery than JSF ?

我喜欢新技术,并且我喜欢JSF到目前为止所看到的东西,但是我也想变得实用,并且许多Google搜索对JSF 2.0提出了一些直言不讳的批评.

I like new technologies and I like what I see so far from JSF but I want to be practical as well, and a lot Google searches turn up some bluntly critical comments about JSF 2.0.

有想法吗?

推荐答案

将JSF与Struts进行比较就像将苹果与橙子进行比较. Struts是基于请求/操作的MVC框架,而JSF是基于组件的MVC框架. Struts也已老化.在IT中,您应该继续前进.通常,基于组件的MVC框架被视为基于请求/操作的MVC框架的进一步发展.

Comparing JSF with Struts is like comparing apples with oranges. Struts is a request/action based MVC framework while JSF is a component based MVC framework. Struts is also aged. In the IT you're supposed to keep moving. Generally, a component based MVC framework is seen as a further evolution of a request/action based MVC framework.

JSF当前已经被非常广泛地使用.确实,它以前曾遭受过很多批评.您可以在问题中了解其中的大多数内容. JSF 2.0的主要缺点是什么? JSF的优势主要在于是Java EE维护的标准以及相对大量的第三方组件库的可用性( RichFaces OpenFaces 战斧等).使用JSF,可以轻松快速地开发出CRUD应用程序和Web表单,而且感觉很好.

JSF is currently already used very widely. It has indeed received a lot of critism before. You can read about most of them in the question What are the main disadvantages of JSF 2.0? The strength of JSF is mainly being a Java EE maintained standard and the availability of relatively a lot of 3rd party component libraries (PrimeFaces, RichFaces, IceFaces, OpenFaces, Tomahawk, etc). With JSF, it's very easy to develop CRUD applications and web forms with nice look'n'feel quickly.

但是,当进入复杂环境时,JSF可能会引起一些无法预料的意外.尽管自从最新的1.2版本以来,JSF规范和参考实现(Mojarra)已经相当成熟,但是您可能会遇到一些非常具体的行为问题,这与您的直觉背道而驰.有些只是设计使然",只有当您详细了解JSF的工作原理时,才能理解它们,而JSF的工作原理通常归结为HTTP协议的无状态本质. JSF本质上太多"地抽象了它,您再也看不到它了.有些只是所使用的第3方组件库中的错误,但是严格来说,这并不是特定于JSF实现的.但是,如果您及时报告错误,则在大多数主要组件库中,错误/问题处理都相当不错.

However when it goes into the complex, JSF may cause some unforeseen surprises. Although the JSF specification and reference implementation (Mojarra) is pretty mature since the latest 1.2 builds, you may encounter some very specific behavioral problems which goes against your intuition. Some are just "by design" and can only be understood when you understand in detail how JSF works under the covers which in turn often boils down to the stateless nature of the HTTP protocol. JSF abstracts it in essence "too much" away that you don't see it anymore. Some are just bugs in the 3rd party component libraries used, but that's thus not strictly JSF-implementation-specific. Bug/issue handling is however pretty good in most of the major component libraries -if you report the bugs timely.

对于Ajaxical的东西,JSF 2.0的确提供了很少的手动控制来手动触发Ajaxical请求并在服务器端和客户端都控制视图树.仅仅因为它是一个基于组件的MVC框架,它使树的状态始终保持在两侧.当您自己动手进行ajaxical工作时,您必须将双方都考虑在内.如果确实在基于ajax/request的操作中需要更多自由度,那么基于组件的MVC框架就是错误的选择.您应该选择基于请求/操作的MVC框架,例如Spring MVC,Struts或Stripes,以及JS库(例如jQuery).但是,您必须自己编写许多HTML/CSS/JS样板.

As to ajaxical stuff, JSF 2.0 indeed provides very little manual control over manually firing ajaxical requests and controlling the view tree in both server and client side. Simply because it's a component based MVC framework which keeps the tree state at the both sides. You've got to take the both sides into account when taking the ajaxical works in your own hands. If you really need more freedom in ajax/request based actions, then a component based MVC framework is simply the wrong choice. You should pick a request/action based MVC framework instead like Spring MVC, Struts or Stripes, along with a JS library like jQuery. You however have to write lot of HTML/CSS/JS boilerplate yourself instead.

这篇关于JSF的采用和普及的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆