如何在Netbeans 6.8中为JSF 1.2中的facelets启用代码完成?

时间:2010-02-22 16:58:00

标签: java jsf netbeans jboss facelets

我想在NetBeans 6.8中为facelets + JSF 1.2启用代码完成。我更喜欢为我使用自己的Ant build.xml构建的自由格式项目启用它,但我看不到启用它的选项,所以我愿意使用“带有现有源的Web应用程序”。

很抱歉所有的截图。我只想展示我的所作所为。

项目设置

Choose a Project dialog

Name & Location dialog

Server & Settings dialog

Existing Sources & Libraries dialog

项目配置 Frameworks dialog with Libraries tab selected

Frameworks dialog with Configuration tab selected

在设置和配置之后,facelets中的代码完成仍然不起作用 Showing editor with failed code-completion

我错过了什么吗?我是以错误的方式解决这个问题吗?

解决方案

这是我最终做的事情:

  1. 我从标准Ja​​va项目切换到Web项目(duh!)
  2. 我拿了Awano's advice并将xhtml文件的MIME类型切换回text / xhtml。
  3. 我将tld file中的facelets site添加到jsf-facelets.jar中的meta-inf目录中,并将其包含在我的项目中。
  4. 我将呈现的属性添加到jsf-ui.tld文件中的fragment标记中。它出于某种原因缺失了:

    <attribute>
        <name>rendered</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
        <description>Renders the contents of this tag if the attribute resolves to true.</description>
    </attribute>
    

1 个答案:

答案 0 :(得分:1)

您是否在项目属性的库中添加了facelet库? 否则,请在工具/选项/杂项/文件中检查xhtml是否与MIME XHTML(text / xhtml)相关联。