java JSF 1.0 与 JSF 2.0

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3063920/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 00:10:03  来源:igfitidea点击:

JSF 1.0 vs JSF 2.0

javajsfframeworksjsf-2web-frameworks

提问by BalusC

What is difference between these 2 version of JSF (JSF 1.0 and JSF 2.0)? As I am new to java, I only find that difference is at Architectural level. But, in perspective, I can't get how much it affects the application development ?

这两个版本的 JSF(JSF 1.0 和 JSF 2.0)有什么区别?由于我是 Java 新手,我只发现差异在于架构级别。但是,从长远来看,我无法理解它对应用程序开发的影响有多大?

Also, the MVC imposed is different with JSF and Spring. Even if JSF has improved architecture, still Spring is much more in use. What is the importance of Spring with above point ?

此外,强加的 MVC 与 JSF 和 Spring 不同。即使 JSF 已经改进了架构,Spring 的使用仍然更多。Spring 的重要性是什么?

回答by BalusC

JSF 1.0 was the first release of the JSF specification (JSR127FR1), released around March 2004. It was pretty buggy and shortcoming and it was improved shortly thereafter with JSF 1.1 (JSR127 FR2) around May 2004. It was later succeeded by JSF 1.2 (JSR252) around May 2006 wherein mainly the EL and the view handling was improved and unified so that it's not tight-coupled to JSP anymore.

JSF 1.0 是 JSF 规范 ( JSR127FR1)的第一个版本,于 2004 年 3 月左右发布。它有很多缺陷和缺陷,此后不久在 2004 年 5 月左右通过 JSF 1.1 (JSR127 FR2) 对其进行了改进。后来由 JSF 1.2 成功( JSR252) 大约在 2006 年 5 月,其中主要是 EL 和视图处理得到改进和统一,使其不再与 JSP 紧密耦合。

JSF 2.0 is the second major release of the JSF specification (JSR314), released around July 2009. Major improvements cover the use of annotations, parameterized types (generics), support for GET requests, ajaxical powers, new viewscope, ability of defining custom scopes, resourcehandlingand the inclusion of Faceletsas default view technology (instead of the legacy JSP).

JSF 2.0 是 JSF 规范 ( JSR314)的第二个主要版本,于 2009 年 7 月左右发布。主要改进包括注释的使用、参数化类型(泛型)、对 GET 请求的支持、ajaxical 权力、新view范围、定义自定义范围的能力、资源处理和包含Facelets作为默认视图技术(而不是传统的 JSP)。

Also see What's new in JSF 2?

另请参阅JSF 2 中的新增功能?

As to which one to choose, just pick the latest. It'll be better. It's the same as asking if you should choose Java 1.0 or Java 1.6.

至于选哪个,选最新的就行了。会更好。这与询问您应该选择 Java 1.0 还是 Java 1.6 相同。



As to the Spring part, it's just an IoC framework. You can do as good without it. You can eventually go for EJB or Java EE 6 CDI (Weld).

至于Spring部分,它只是一个IoC框架。没有它,你也可以做得很好。您最终可以选择 EJB 或 Java EE 6 CDI(焊接)。