quality@glassfish.java.net

Optional web.xml for JSF

From: Cay Horstmann <cay.horstmann_at_gmail.com>
Date: Thu, 9 Jun 2011 19:01:51 +0700

Hi, I am pretty sure that GlassFish 3.0 did the faces/ or *.faces
mapping for JSF apps under one of three situations:

    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

At least that's what this blog said, so it must be right :-)
http://weblogs.java.net/blog/cayhorstmann/archive/2009/10/19/another-small-step-jsf

But I just happened to try this on GF 3.1. I had a web.xml file with

   <context-param>
      <param-name>javax.faces.PROJECT_STAGE</param-name>
      <param-value>Development</param-value>
   </context-param>

no JSF 2.0 annotations (because I used CDI) and no faces-config.xml
file. That was not enough to trigger the faces servlet. Adding an
empty faces-config.xml file did the trick, but it's pretty silly.

For the life of me, I can't figure out where I got those three
conditions--it's not in the JSF 2.0 spec, but I understand it will be
in the 2.1 spec.

Can anyone shed any light on this? Was this just some implementation
detail that changed between 3.0 and 3.1?

Thanks,

Cay