我需要补充Java EE 6,JSF-2 Web-App的框架吗?哪个? [英] Do I need frameworks to complement a Java EE 6, JSF-2 Web-App? Which ones?

查看:141
本文介绍了我需要补充Java EE 6,JSF-2 Web-App的框架吗?哪个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以前的J2EE版本中,通常的做法是使用Spring,Hibernate,Struts等框架来补充默认库.
Java EE 6似乎缩小了差距(与CDI,JPA,JSF2.0等一起使用)-我是否仍应使用其他框架(Seam,faces库或Spring?)

In the previous J2EE versions, it was common practice to complement the default libraries with frameworks like Spring, Hibernate, Struts, etc.
Java EE 6 seemed to close the gap (with CDI, JPA, JSF2.0, etc.) - should I still use additional frameworks (Seam? A faces library? Spring?)

我当前正在使用默认的Oracle堆栈-GlassFish v3,JSF(Mojarra)2.0

I am currently using the default Oracle stack - GlassFish v3, JSF (Mojarra) 2.0

推荐答案

J2EE 1.3和J2EE 1.4的常见做法确实是在J2EE堆栈上添加了很多其他框架.从理论上讲,您可以仅使用J2EE来构建应用程序,但我认为甚至Sun都不建议对任何非平凡的应用程序这样做.

The common practice in J2EE 1.3 and J2EE 1.4 was indeed to supplement the J2EE stack with quite a lot of additional frameworks. Theoretically you could build an application using only J2EE, but I think not even Sun recommended doing that for any non-trivial application.

您提到的框架(Spring,Hibernate和Struts)正是我记得经常使用的框架.

The frameworks you mentioned (Spring, Hibernate and Struts) are exactly the ones I remember that were often used.

从Java EE 5开始,现在肯定是Java EE 6,您不再需要其他框架.现在,可以使用轻量级的EJB3.1和CDI组件模型来完成将Spring核心容器添加到J2EE中的所有事情,JPA提供ORM支持(通常由Hibernate实现,但除此之外),MVC Web框架是该框架的一部分.通过JSF 2的标准堆栈.

Starting from Java EE 5, and now certainly with Java EE 6 you don't need additional frameworks anymore. Everything the core Spring container added to J2EE can now be done with the lightweight EJB3.1 and CDI component models, ORM support is provided by JPA (which is often implemented by Hibernate, but that aside) and an MVC web framework is part of the standard stack via JSF 2.

当然,个人仍然可能更喜欢Spring和Struts编程API,但是使用Java EE 6并没有迫切需要使用它们.或者换句话说,它不再是补充Java EE的绝对必要.

Of course individuals may still prefer the Spring and Struts programming APIs, but with Java EE 6 there is no pressing need to use them. Or put differently, it's no longer absolutely needed to complement Java EE.

也就是说,Seam确实为Java EE提供了一些不错的(便携式)扩展,并且JSF实际上是为与扩展和第三方组件库一起使用而构建的.但是,此类组件库并不是真正的框架",而只是为您提供了可在页面上使用的额外小部件.这与用Struts或GWT替换JSF有所不同.

That said, Seam does provide some nice (portable) extensions to Java EE and JSF was actually build to be used with extension and third party component libraries. Such component library is however not really a 'framework', but just gives you extra widgets to use on your pages. It's not the same thing as replacing JSF with say Struts or GWT.

这篇关于我需要补充Java EE 6,JSF-2 Web-App的框架吗?哪个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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