That isn't true. You just need to trick your IDE to make it believe it
supports facelets. Rick Hightower posted an article about that on
developerworks, currently I can't find the link, but the pattern is quite
easy.

Use jspx as your view extension (instead of xhtml) and register that in your
web.xml:

<context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.jspx</param-value>
   </context-param>
   <context-param>
       <param-name>facelets.VIEW_MAPPINGS</param-name>
       <param-value>*.jspx</param-value>
   </context-param>

And then put a xml declaration and a jsp:root element into your facelets
view:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page";
   xmlns="http://www.w3.org/1999/xhtml";
   xmlns:h="http://java.sun.com/jsf/html";
   xmlns:f="http://java.sun.com/jsf/core";
   xmlns:c="http://java.sun.com/jstl/core";
   xmlns:ui="http://java.sun.com/jsf/facelets";
   xmlns:t="http://myfaces.apache.org/tomahawk";
   version="2.0">
<ui:composition>
your stuff
</ui:composition>
</jsp:root>

Now my eclipse-based IDE think I'm editing a JSP and provides content assist
for all standard JSF components.

The support still isn't as good as for JSPs because I don't provide the IDE
with tlds for "custom" tags or components. But I can live with that,
facelets makes my work easy enough anyway.

Reply via email to