Hmmm...Seems like this 'Ed Burns' guy just might know what he's talking about.
Indeed, in JSF 2.1 there's some heavy promotion of the fact that the web.xml file is optional in a JavaServer Faces application.
Here's what the aquarium says about it:
In the case of GlassFish v3.0, web.xml is optional and there is no longer the need to declare the Faces servlet
-
The Aquarium
Cay has written a bit about it in his blog:
GlassFish automatically provides a JSF servlet mapping for the /faces/*, *.faces, and *.jsf patterns, provided that any of the following conditions applies:
*Any of the classes in the web application uses a JSF 2.0 annotation
*Any initialization parameters start with javax.faces
*The WEB-INF/faces-config.xml file is present
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.
Cay's Blog
Most of the talk here is that "Glassfish" automatically maps the FacesServlet. Now my question is whether this is just a sweet thing Glassfish designers decided, or whether this is just part of the Java EE specification. Since I can't seen the people at GlassFish doing this just out of the good of their heart, my assumption is that it is a Java EE requirement?
I'm currently deploying to Apache
Tomcat 7, so my guess is that since Tomcat 7 is only a Servlet Engine, and not a full blow Java EE server, for Tomcat I'd still need the mapping.
Interesting stuff!