views:

454

answers:

1

I'd like to enable code completion for facelets + JSF 1.2 in NetBeans 6.8. I'd prefer to enable it for a free-form project that I build using my own Ant build.xml, but I see no options to enable that, so I'm willing to go with a "Web Application with Existing Sources".

Sorry for all of the screen-shots. I just want to show what I did.

Project Setup

Choose a Project dialog

Name & Location dialog

Server & Settings dialog

Existing Sources & Libraries dialog

Project Configuration Frameworks dialog with Libraries tab selected

Frameworks dialog with Configuration tab selected

After setup and configuration, code-completion within facelets still doesn't work.
Showing editor with failed code-completion

Am I missing something? Am I going about this in the wrong way?

Solution

Here's what I ended up doing:

  1. I switched from a Standard Java project to a Web project (duh!)
  2. I took Awano's advice and switched the MIME type for xhtml files back to text/xhtml.
  3. I added the tld file from the facelets site to the meta-inf directory in the jsf-facelets.jar and included it in my project.
  4. I added the rendered attribute to the fragment tag in the jsf-ui.tld file. It was missing for some reason:

    <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  A: 

Did you add the facelet libs in the libraries of your project properties? Otherwise check that in Tools / Options / Miscellaneous / Files that xhtml is associated with MIME XHTML (text/xhtml).

Awano
I added the "JSF 1.2 + Facelets 1.1.14 library" and it had no affect. I also tried switching to the text/xhtml MIME type. It also had no affect. Thanks!
braveterry
Do you use the official Netbeans 6.8? It seems they were some bugs on xhtml autocompletion in intermediary builds.
Awano
As far as I know. I'm running NetBeans IDE 6.8 (Build 200912041610)
braveterry
@Awano: THANK YOU! Our team has named our Facelets files with the .JSF extension and I was pulling my hair out trying to figure out why I didn't get any code completion.
roufamatic