title: How do I enable code-completion in Netbeans 6.8 for facelets in JSF 1.2?
body: <p>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".</p>
  
  <p><em>Sorry for all of the screen-shots.</em> I just want to show what I did.</p>
  
  <p><strong>Project Setup</strong></p>
  
  <p><img src="https://i247.photobucket.com/albums/gg155/catchthebonus/ChooseProject.png" alt="Choose a Project dialog"></p>
  
  <p><img src="https://i247.photobucket.com/albums/gg155/catchthebonus/NameAndLocation.png" alt="Name &amp; Location dialog"></p>
  
  <p><img src="https://i247.photobucket.com/albums/gg155/catchthebonus/ServerAndSettings.png" alt="Server &amp; Settings dialog"></p>
  
  <p><img src="https://i247.photobucket.com/albums/gg155/catchthebonus/ExistingSourcesAndLibraries.png" alt="Existing Sources &amp; Libraries dialog"></p>
  
  <p><strong>Project Configuration</strong>
  <img src="https://i247.photobucket.com/albums/gg155/catchthebonus/ProjectPropertiesFrameworksLibrarie.png" alt="Frameworks dialog with Libraries tab selected"></p>
  
  <p><img src="https://i247.photobucket.com/albums/gg155/catchthebonus/ProjectPropertiesFrameworksConfigur.png" alt="Frameworks dialog with Configuration tab selected"></p>
  
  <p>After setup and configuration, code-completion within facelets still doesn't work.<br>
  <img src="https://i247.photobucket.com/albums/gg155/catchthebonus/NoCodeCompletion.png" alt="Showing editor with failed code-completion"></p>
  
  <p>Am I missing something?  Am I going about this in the wrong way?</p>
  
  <h1>Solution</h1>
  
  <p>Here's what I ended up doing:</p>
  
  <ol>
  <li>I switched from a Standard Java project to a Web project (duh!)</li>
  <li>I took <a href="https://stackoverflow.com/users/254719/awano">Awano's advice</a> and switched the MIME type for xhtml files back to text/xhtml.</li>
  <li>I added the <a href="https://facelets.dev.java.net/files/documents/3448/21641/jsf-ui.tld" rel="nofollow noreferrer">tld file</a> from the <a href="https://facelets.dev.java.net/" rel="nofollow noreferrer">facelets site</a> to the meta-inf directory in the jsf-facelets.jar and included it in my project.</li>
  <li><p>I added the <em>rendered</em> attribute to the fragment tag in the jsf-ui.tld file.  It was missing for some reason:</p>
  
  <pre><code>&lt;attribute&gt;
      &lt;name&gt;rendered&lt;/name&gt;
      &lt;required&gt;false&lt;/required&gt;
      &lt;rtexprvalue&gt;false&lt;/rtexprvalue&gt;
      &lt;description&gt;Renders the contents of this tag if the attribute resolves to true.&lt;/description&gt;
  &lt;/attribute&gt;
  </code></pre></li>
  </ol>