There are lots of requests that asking when and how the Facelets support be available on NetBeans 6.1. Yes, there is plan to officially release the support NBMs by the update center for NetBeans 6.1. We are currently working on that to resolve several compatible issues and migrate the internal APIs usage to NetBeans 6.1. When it is ready for the final release, we will announce it and make it available and show them under the Available Plugins list of NetBeans 6.1.
According to the Open Sources concept, any users or developers can always pre-build their latest binaries and try/test before the official releases. This is also true for the Facelets plugin and believe me, it's very simple and can be done in just minutes! We have already done many tasks for the NetBeans 6.1 migration to ease the build requirement.



If you do want to skip the 'build from sources' steps, you may just download these NBMs (nbfaceletssupport-6.1.zip) that I have done.
The next step is to install the Facelets NBMs that we have just created into
the IDE. You can invoke the Plugins dialog by menu Tools -> Plugins, select the
Downloaded tab and click on Add Plugins... to open these 4 NBMs.

Then click on Install, follow few Next/Continue/Finish clicking and accept the license agreements, finally your IDE is ready for the Facelets Support, on the latest released NetBeans 6.1!
After installed the Facelets Support, you will find a new entry 'Facelets' in
the Frameworks panel when you create a new web project. Select and check this
entry before clicking on Finish. Multiple frameworks selection should work but
is not a supported feature as there is no much testing has been done here.

As you can see, options for 'JavaServer Faces Configuration' are all
non-editable because the project creating currently only supports the default
settings. However, it is still possible to modify them after the project has
been created.
To see what you have for the new Facelets project, expand the folder nodes under the Project panel.

The IDE recognizes a file as a Facelets file if:
You may want to try the one-click deploy toolbar button (the green arrow) now to see the simple welcome Facelets been deployed on your browser.
Now we are going to add more interesting contents to our
Facelets project. When you focus on the Facelets .xhtml editor, you will
notice that there are extra palettes available for your Facelets pages.

Let's add more JSF components into our boring welcome page by drag-n-drop the palette to the .xhtml editor. I have done here by just drag-n-drop an outputText and a commandButton to the editor and change their values to something meaningful.
<ui:define name="body">
Hello, this text comming from template client.
<p>
<h:outputText value="Go to Next Page:"/>
<h:commandButton id="GO" value="GO"/>
</p>
</ui:define>
Click on the Run button and you will see the
following contents appear in your browser:

To add more Facelets files to your project, right click on the Web Pages node
and select New -> Other... to invoke the New File dialog. Select the JavaServer
Faces category and you will see there are 3 templates for the Facelets support:



The IDE provides tag code completion for all Facelets tag libraries that are included in the web project. The IDE scans the tag libraries definition file in the same way as Facelets does. These XML files can be referenced in the following two ways:
By default code completion offers the tags with default prefixes. Developers
can add extra namespace definition or modify the default prefix. The code
completion will adjust to include the new prefixes in the list.

The default prefixes are:
| xmlns="http://www.w3.org/1999/xhtml" | JSTL Core |
| xmlns:ui="http://java.sun.com/jsf/facelets" | JSF - Facelets |
More available prefixes are also available when drag-n-drop components from the Palette:
| xmlns:f="http://java.sun.com/jsf/core" | JSF - core components |
| xmlns:h="http://java.sun.com/jsf/html" | JSF - html components |
The namespace will automatically be imported into the root tag when you drag-n-drop a Facelets component or by using the code completion to add one.
| Add Facelets component by Code Completion: | Namespace automatically been added into the root tag: |
|---|---|
| ![]() |
Extra html tags support for the attribute jsfc (JavaServer Faces Component) are available (see Facelets developer documentation) from the code completion.
| Code Completion shows the attribute jsfc: | Code Completion for the attribute jsfc: | Namespace automatically been added into the root tag: |
|---|---|---|
| | ![]() |
By default, the Facelets tag code completion provides tag attributes for the following standard Facelets libraries:
The IDE also scans the project classpath for all tld files. The code completion
will provide extra attribute support if the tld file defines the Facelets Tag
library. Their associate dynamic help will also be provided.

By using the Hyperlink, developers can fast navigate from one source to another reference. You can visualize the link by holding down the CTRL key and mouse over a hyperlink active area. After you see the text changed into a link, click on it by the left mouse button. An appropriate source should be open. The tables below briefly displays this feature in the Facelets support.
| Example | File opened |
|---|---|
| <ui:composition template = "/template.xhtml"> | the template source |
| <ui:include src = "/content/top.xhtml"> | the source file |
| Example | File opened |
|---|---|
| <h3>from #{NumberBean.min} to #{NumberBean.max}</h3> | the faces configuration file on position where the managed bean been defined |
| <h3>from #{NumberBean.min} to #{NumberBean.max}</h3> | the appropriate java file on position where the getter for the property been defined |
| Example | Refactoring UI |
|---|---|
| Managed Beans | ![]() |
| Folder / Package | ![]() |
Move support associate with the refactoring is also provided. The following example shows the preview of moving ManagedBeans.java from package foo to package bar.
| Example | Move UI |
|---|---|
| Managed Beans | ![]() |
Save Delete support associate with the refactoring is also provided which will search the usage with preview.
The Facelets support will plug into the Java find usages to show JSF beans definitions which refer to Java elements (classes, methods, fields, properties). The Find Usages action will be available for bean definitions as well, to show beans used by other beans. The following example shows how the managed bean file, ManagedBeans.java has been referred by the JSF configuration files and other bean files.
| Example | Usages UI |
|---|---|
| Managed Beans | ![]() |
There are two sample projects included in these modules. The first one is
Facelets Template Examples that shows the example of layouts usage. The second
one is the well known Number Guess Example by using the Facelets. You may simply
create the project and deploy to see the Facelets in your browser.

In case you need to uninstall the Facelets Support for any reason, use the
menu Tools -> Plugins to get the dialog, select the Installed tab and choose
'Facelets Support', 'Simple JSF/Facelets Snippets', and 'Facelets Library
1.1.14', then click on Uninstall to uninstall the support.
| BuildNBM.gif | ![]() |
12191 bytes |
| CodeCompletion1.gif | ![]() |
31414 bytes |
| CodeCompletion2.gif | ![]() |
6148 bytes |
| CodeCompletion3.gif | ![]() |
4922 bytes |
| CodeCompletion4.gif | ![]() |
5880 bytes |
| CodeCompletion5.gif | ![]() |
6783 bytes |
| CodeCompletion6.gif | ![]() |
5117 bytes |
| CodeCompletion7.gif | ![]() |
18485 bytes |
| CreateProject.gif | ![]() |
23249 bytes |
| Deployment1.gif | ![]() |
2497 bytes |
| GetSource1.gif | ![]() |
15138 bytes |
| GetSource2.gif | ![]() |
16384 bytes |
| InstallNBM1.gif | ![]() |
25405 bytes |
| Move.gif | ![]() |
28664 bytes |
| NewFile.gif | ![]() |
22812 bytes |
| NewTemplate.gif | ![]() |
20202 bytes |
| NewTemplateClient.gif | ![]() |
18713 bytes |
| OpenProject.gif | ![]() |
19092 bytes |
| Palette.gif | ![]() |
47917 bytes |
| ProjectsView.gif | ![]() |
12845 bytes |
| Refactoring1.gif | ![]() |
32624 bytes |
| Refactoring2.gif | ![]() |
35741 bytes |
| SafeDelete.gif | ![]() |
10697 bytes |
| SampleProject.gif | ![]() |
24156 bytes |
| UninstallNBM.gif | ![]() |
33477 bytes |
| Usages.gif | ![]() |
12085 bytes |
| nbfaceletssupport.zip | ![]() |
3127120 bytes |