如何在eclipse用户库中启用JSF方面 [英] How to Enable the JSF facet in eclipse user library

查看:140
本文介绍了如何在eclipse用户库中启用JSF方面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse中有麻烦启用JSF。我已经安装了应该包含JSF的WPT工具,但是当我右键单击我的项目,属性,方面,启用方面时,我收到警告说需要进一步配置我点击这个,然后我被告知至少必须选择一个用户库但是没有库可供选择。

I'm having troulbe enabling JSF in Eclipse. I have installed the WPT tools that should have had JSF included but when I right click on my project, properties, facets, enable facets I get a warning saying "Further configuration required" I click this, and I'm notified that "At least one user library must be selected" However there are no libraries to select.

我可以选择禁用库配置,但我不知道这会产生什么影响,因为Eclipse告诉我必须配置用户库。

I can optionally select "Disable Library Configuration" but I don't know what effects this might have as Eclipse is telling me that i must configure a user library.

我应该从Mojarra下载一个单独的Jar并将其添加到我的构建中吗?或者我可以安全地禁用。为什么WTP不包括它应该是什么?

Should I download a separate Jar from the Mojarra and add this to my build? Or can I safely disable. Why wasn't it included with WTP like it was supposed to be?

推荐答案


必须至少选择一个用户库但是没有可供选择的库。

你必须准备它们你自己通过 Window> Preferences> Java> Build Path> User Libraries

You have to prepare them yourself by Window > Preferences > Java > Build Path > User Libraries.


我可以选择禁用库配置,但我不知道这可能会产生什么影响,因为Eclipse告诉我必须配置用户库。

当您选择此选项时,Eclispe还会告诉您用户负责通过其他方式适当地配置类路径。

When you choose this option, Eclispe will also tell you that the user takes the responsibility of configuring the classpath appropriately via alternate means.


我应该从Mojarra下载一个单独的Jar并将其添加到我的构建中吗?或者我可以安全地禁用。

这是另一种方法。是否需要自己下载取决于项目的目标运行时。如果它是一个简单的JSP / Servlet容器,它不附带捆绑的JSF,例如Tomcat 7,那么你确实需要自己安装它。只需将JAR放在 / WEB-INF / lib 中即可(或者将其定义为用户库)。 Eclipse将自动为您做正确的事情(添加到构建路径,包括导出的WAR等)。但是,如果它是一个更完整的Java EE容器,例如Glassfish 3,那么您不需要做任何事情,因为它已经将JSF捆绑为Java EE API的一部分。只需完全禁用库配置。

That's one of the alternative ways. Whether you need to download it yourself depends on the project's target runtime. If it's for example a simple JSP/Servlet container which does not ship with bundled JSF, such as Tomcat 7, then you indeed need to install it yourself. Just dropping the JAR(s) in /WEB-INF/lib is sufficient (or defining it as an user library, of course). Eclipse will automagically do the right things for you (adding to build path, including in exported WAR, etc). However, if it's for example a more full fledged Java EE container, such as Glassfish 3, then you don't need to do anything as it already bundles JSF as part of Java EE API. Just disable the library configuration altogether.


为什么它不包括在内它应该是WTP吗?

它们包含JSF工具。但它们不包含JSF库。或者你读过了吗?如果是这样,究竟在哪里?这一定是错误的信息或误解。

They have JSF tools included. They do however not include JSF libraries. Or did you read otherwise? If so, where exactly? It must have been a misinformation or misinterpretation.

  • JSF 2.0 tutorial with Eclipse and Glassfish

这篇关于如何在eclipse用户库中启用JSF方面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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