向我解释一下不同的 JSF 组件库的关系
尽管我花了一整天的时间开发 JSF 应用程序,但我从未接受过任何关于此事的培训,而且我必须管理我仍然困惑整个 JSF 难题如何组合在一起。 JSF 在我看来有点混乱。
- jsf-api
- jslt
- facelets
- myfaces
- 特立尼达
- 多巴哥
- jsp api
如果有人能给我这些组件的快速描述,我将非常感激,哪些组件是标准的,哪些可以省略,哪些可以/需要一起使用
Even though i spend whole days developing a JSF application, i've never had any training on the matter and I have to admin I am a still confused how the whole JSF puzzle fits together. JSF just looks a bit thrown together to me.
- jsf-api
- jslt
- facelets
- myfaces
- trinidad
- tobago
- jsp api
I'd be very grateful if anyone could give me a quick description of these components, which ones are standard, which ones can be left out, which ones can/need to be used together
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
JSP和JSTL
JSP经历了多次迭代,但这却是Java EE动态页面的核心技术。这是一个可服务的 API,但使用 JSP 通常意味着需要对代码/资源进行更多的手动管理。
JSTL 是 JSP 标准模板库。这是一组标准 JSP 标记。不要将这些标签与 JSF 标签混合;它们属于不同的编程模型。
JSF API
JSF 规范。这是 JSF Model-View-Presenter 框架的核心。这指定了一组简单的核心组件和核心生命周期工件。有两种广为人知的实现:Mojarra(开源 Sun API)和 Apache MyFaces。 Java EE 5 及更高版本的一部分。
Facelets
为 JSF 设计的视图技术。使用它代替 JSP。您不能在 Facelets 视图中使用 JSP 标记。这不是 Java EE 5 中的标准,但在 JSF2(以及即将推出的 Java EE 6)中实现了标准化。 Facelets 提供的更好的模板通常意味着您可以减少对第 3 方库的依赖。
Facelets 提供了一些看起来像 JSP JSTL 标记的标记,但不共享任何代码。通常也应该避免使用这些标记(请参阅 Facelets 文档以获取建议)。
Apache Trinidad and Tobago
这些是提供组件和其他设施的 JSF 库。由于核心控件集相当基本,因此通常使用此类库,特别是在不使用 Facelets 的情况下。这些不是 Java EE 标准的一部分。库兼容性各不相同。另请参阅 jsfmatrix.net。
JSP and JSTL
JSP has undergone many iterations, but this is the core Java EE dynamic page technology. This is a servicable API, but working with JSPs often means more manual management of code/resources.
JSTL is the JSP Standard Template Library. This is a set of standard JSP tags. Do not mix these tags with JSF tags; they belong to a different programming model.
JSF API
The JSF specification. This is the core of the JSF Model-View-Presenter framework. This specifies a simple set of core components and the core lifecycle artefacts. There are two widely known implementations: Mojarra (the open sourced Sun API) and Apache MyFaces. Part of Java EE 5 and above.
Facelets
A view technology designed for JSF. Use this instead of JSPs. You cannot use JSP tags in Facelets views. This is not standard in Java EE 5, but is standardized in JSF2 (and therefore the upcoming Java EE 6). The better templating provided by Facelets often means you can rely less on 3rd party libraries.
Facelets provides some tags that look like JSP JSTL tags, but don't share any code. These tags should generally be avoided too (see Facelets doc for advice).
Apache Trinidad and Tobago
These are JSF libraries that provide components and other facilities. Because the core set of controls is rather basic, it is common to use such libraries, especially if Facelets is not used. These are not part of the Java EE standard. Library compatibility varies. See also jsfmatrix.net.