Another Small Step for JSF...

In the relentless fight against configuration boilerplate, JSF and Glassfish have taken yet another small step forward. As of Glassfish v3 build 68, you no longer need to declare the faces-servlet in WEB.XML.

<servlet>
   <servlet-name>Faces Servlet</servlet-name>
   <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>Faces Servlet</servlet-name>
   <url-pattern>/faces/*</url-pattern>
</servlet-mapping>

In fact, you can omit web.xml altogether, except then you don't get to set javax.faces.PROJECT_STAGE to Development. (Since I am a developer, I think it's too bad that's not the default.)

GlassFish automatically provides a JSF servlet mapping for the /faces/*, *.faces, and *.jsf patterns, provided that any of the following conditions applies:

Isn't it grand? Now you can have a JSF app without web.xml or faces-config.xml, just a bunch of .xhtml pages and Java classes annotated with @ManagedBean.

The only fly in the ointment is that, if you really want to be thoroughly modern and use web beans, erm, JSR 299 Contexts and Dependency Injection, then you should still leave something in place to trigger the servlet mapping.

Another nifty step forward: NetBeans 6.8 Milestone 2 now does autocompletion on JSF 2.0 facelets pages, including tags, attributes and even EL expressions.

For example, here, Netbeans has found a @ManagedBean(name="user") and located name and password properties.

It might be a good idea to filter out the useless Object methods—when is the last time you wanted to call notifyAll in an EL expression? Or worse, wait :-)

After EE5 came out, I did all my EE development in Netbeans. It gave me one-stop shopping, bundling everything that I needed in a single download. I moved to Eclipse when Netbeans couldn't deal with EE6 improvements such as the simplified packaging. It worked in Eclipse (out of ignorance, not some grand plan), and that's what I used for the last 12 months or so. It was reasonably satisfied, thanks to the Glassfish Eclipse plugin, but Eclipse's support for editing JSF pages is extremely basic. Now I am very tempted to go back to Netbeans—I am a sucker for autocompletion.