Re: [REVIEW] ConfigureListener - check for FacesServlet before performing faces configuration steps

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Thu, 17 Feb 2005 17:07:30 -0500

Adam Winer wrote:

> Ed Burns wrote:
>>>>>>> On Thu, 17 Feb 2005 15:42:01 -0500, Ryan Lubke
>>>>>>> <Ryan.Lubke_at_Sun.COM> said:
>> RL> Consider the case where JSF is installed in the common
>> classloader of RL> Tomcat, or SJSAS.
>> RL> With this configuration, the ConfigureListener will be invoked
>> for every RL> web application
>> RL> whether or not it uses JSF.
>> RL> This modification to ConfigureListener will process the web.xml
>> of the RL> current web application
>> RL> scanning for the presence of javax.faces.webapp.FacesServlet. If
>> found, RL> perform the normal
>> RL> application processing, otherwise return.
>> As it turns out, an app is not required to map the FacesServlet by the
>> spec.
> IIRC, ViewHandlerImpl in the RI does in fact look for
> FacesServlet to figure out servlet mappings, so there is
> currently a requirement to use FacesServlet. That hard
> dependency is not necessary, because ViewHandlerImpl could simply
> look for *all* servlet mappings, and whichever servlet
> mapping corresponds to the current request is necessarily
> the correct servlet, whether or not it's FacesServlet.

Actually, I think we're clear.

Section 10.1 states the following (second paragraph):

"Portable JSF-based web applications _must_ include the following
configuration elements,
in the appropriate portions of the weba pplication deployment descriptor.
Elment values that are rendered in italics represent values that the
developer is free to choose. Element values rendered in bold represent
that must be utilized exactly as shown"

So, if the application is portable, we can rely on the FacesServlet
class being

For those that choose not to use the FacesServlet, I propose that we add
a new
RI specific context parameter, something like
that can be specified which will load the configuration without
interogating the web.xml.


>> Check out
>> <>.
>> So, I think we should consider developing a very robust heuristic, of
>> which "does it map the FacesServlet?" is a part. How about:
>> If any of the following are true, we know this app definately uses
>> Faces.
>> * It maps the FacesServlet
>> * It has a faces-config (or similar) file (check the init param)
>> If neither of these are true, you probably don't have a faces app.
>> What do you all think?
> Seems viable.
> -- Adam
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail: