dev@javaserverfaces.java.net

[REVIEW] Reorder web.xml scanning and init message

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Fri, 16 Feb 2007 11:16:29 -0800


*******************************************************************
* SECTION: Modified Files
*******************************************************************
M src/com/sun/faces/config/ConfigureListener.java
  - Pull the web.xml scanning section out of try/catch block.
  - move initialize message *after* the web.xml scan
    so that the message is only printed if JSF is going
    to be initialized
 
 
 
 
 
 
*******************************************************************
* SECTION: Diffs
*******************************************************************
Index: src/com/sun/faces/config/ConfigureListener.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/config/ConfigureListener.java,v
retrieving revision 1.94
diff -u -r1.94 ConfigureListener.java
--- src/com/sun/faces/config/ConfigureListener.java 5 Feb 2007 00:00:12 -0000 1.94
+++ src/com/sun/faces/config/ConfigureListener.java 16 Feb 2007 19:06:00 -0000
@@ -288,43 +288,42 @@
         if (initialized = initialized()) {
             return;
         }
-
- // store the servletContext instance in Thread local Storage.
- // This enables our Application's ApplicationAssociate to locate
- // it so it can store the ApplicationAssociate in the
- // ServletContext.
- tlsExternalContext.set(new ServletContextAdapter(context));
+
+ // Check to see if the FacesServlet is present in the
+ // web.xml. If it is, perform faces configuration as normal,
+ // otherwise, simply return.
+ if (!isFeatureEnabled(BooleanWebContextInitParameter.ForceLoadFacesConfigFiles)) {
+ WebXmlProcessor processor = new WebXmlProcessor(context);
+ if (!processor.isFacesServletPresent()) {
+ if (LOGGER.isLoggable(Level.FINE)) {
+ LOGGER.fine(
+ "No FacesServlet found in deployment descriptor -"
+ +
+ " bypassing configuration.");
+ }
+ return;
+ }
+
+ if (LOGGER.isLoggable(Level.FINE)) {
+ LOGGER.fine("FacesServlet found in deployment descriptor -"
+ +
+ " processing configuration.");
+ }
+ }
 
         try {
-
+
             if (LOGGER.isLoggable(Level.INFO)) {
                 LOGGER.log(Level.INFO,
                            "jsf.config.listener.version",
                            getServletContextIdentifier(context));
             }
 
- // Check to see if the FacesServlet is present in the
- // web.xml. If it is, perform faces configuration as normal,
- // otherwise, simply return.
- if (!isFeatureEnabled(BooleanWebContextInitParameter.ForceLoadFacesConfigFiles))
- {
- WebXmlProcessor processor = new WebXmlProcessor(context);
- if (!processor.isFacesServletPresent()) {
- if (LOGGER.isLoggable(Level.FINE)) {
- LOGGER.fine(
- "No FacesServlet found in deployment descriptor -"
- +
- " bypassing configuration.");
- }
- return;
- }
-
- if (LOGGER.isLoggable(Level.FINE)) {
- LOGGER.fine("FacesServlet found in deployment descriptor -"
- +
- " processing configuration.");
- }
- }
+ // store the servletContext instance in Thread local Storage.
+ // This enables our Application's ApplicationAssociate to locate
+ // it so it can store the ApplicationAssociate in the
+ // ServletContext.
+ tlsExternalContext.set(new ServletContextAdapter(context));
 
             // Prepare local variables we will need
             FacesConfigBean fcb = new FacesConfigBean();
*******************************************************************
* SECTION: New Files
*******************************************************************
SEE ATTACHMENTS