dev@javaserverfaces.java.net

[REVIEW] Update JSP ELResolver registration messages to include the context name

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Mon, 22 May 2006 12:56:39 -0700

Added:
  - context name property to ApplicationAssociate
  - the context name to the JSP ELResolver registration message

ConfigureListener will call ApplicationAssociate.setContextName()
before it exits the contextInitialized() method.


SECTION: Modified Files
----------------------------
M src/com/sun/faces/LogStrings.properties
M src/com/sun/faces/application/ApplicationAssociate.java
M src/com/sun/faces/config/ConfigureListener.java
M src/com/sun/faces/lifecycle/ELResolverInitPhaseListener.java


SECTION: Diffs
----------------------------
Index: src/com/sun/faces/LogStrings.properties
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/LogStrings.properties,v
retrieving revision 1.15
diff -u -r1.15 LogStrings.properties
--- src/com/sun/faces/LogStrings.properties 22 May 2006 16:56:32
-0000 1.15
+++ src/com/sun/faces/LogStrings.properties 22 May 2006 19:55:20 -0000
@@ -55,8 +55,8 @@
 jsf.config.webconfig.enventry.clientencrypt=JSF1024: [{0}] Client state
encyrption: ENABLED
 jsf.config.webconfig.param.deprecated=JSF1025: [{0}] Context
initialization parameter ''{1}'' is deprecated. The option will still
be configured, but please use ''{2}'' in the future.
 jsf.config.webconfig.option.notconfigured=JSF1026: [{0}] Configuration
option ''{1}'' not configured
-jsf.lifecycle.initphaselistener.resolvers_not_registered=JSF1027: The
ELResolvers for JSF were not registered with the JSP container.
-jsf.lifecycle.initphaselistener.resolvers_registered=JSF1028: The
ELResolvers for JSF successfully registered with the JSP container.
+jsf.lifecycle.initphaselistener.resolvers_not_registered=JSF1027: [{0}]
The ELResolvers for JSF were not registered with the JSP container.
+jsf.lifecycle.initphaselistener.resolvers_registered=JSF1028: [{0}] The
ELResolvers for JSF successfully registered with the JSP container.
 jsf.spi.injection.provider_not_implemented=JSF1029: The specified
InjectionProvider implemenetation ''{0}'' does not implement the
InjectionProvider interface.
 jsf.spi.injection.provider_not_found=JSF1030: The specified
InjectionProvider implementation ''{0}'' cannot be loaded.
 jsf.spi.injection.provider_cannot_instantiate=JSF1031: The specified
InjectionProvider ''{0}'' cannot be instantiated.
Index: src/com/sun/faces/application/ApplicationAssociate.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java,v
retrieving revision 1.31
diff -u -r1.31 ApplicationAssociate.java
--- src/com/sun/faces/application/ApplicationAssociate.java 22 May
2006 15:05:55 -0000 1.31
+++ src/com/sun/faces/application/ApplicationAssociate.java 22 May
2006 19:55:20 -0000
@@ -132,6 +132,8 @@
     private CompositeELResolver facesELResolverForJsp = null;
 
     private InjectionProvider injectionProvider;
+
+ private String contextName;
 
     public ApplicationAssociate(ApplicationImpl appImpl) {
     app = appImpl;
@@ -231,6 +233,14 @@
     
     public InjectionProvider getInjectionProvider() {
         return injectionProvider;
+ }
+
+ public void setContextName(String contextName) {
+ this.contextName = contextName;
+ }
+
+ public String getContextName() {
+ return contextName;
     }
 
     /**
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.75
diff -u -r1.75 ConfigureListener.java
--- src/com/sun/faces/config/ConfigureListener.java 18 May 2006
22:36:37 -0000 1.75
+++ src/com/sun/faces/config/ConfigureListener.java 22 May 2006
19:55:20 -0000
@@ -516,20 +516,22 @@
             registerELResolverAndListenerWithJsp(context);
         } finally {
             if (!initialized) {
- JSFVersionTracker tracker = getJSFVersionTracker();
- if (null != tracker) {
- tracker.publishInstanceToApplication();
- }
- releaseDigester(digester);
- }
+ JSFVersionTracker tracker = getJSFVersionTracker();
+ if (null != tracker) {
+ tracker.publishInstanceToApplication();
+ }
+ releaseDigester(digester);
+ }
             tlsExternalContext.set(null);
-
+ ApplicationAssociate.getInstance(context)
+ .setContextName(getServletContextIdentifier(context));
+
             if (LOGGER.isLoggable(Level.INFO)) {
                 LOGGER.log(Level.INFO,
                            "jsf.config.listener.version.complete",
                            getServletContextIdentifier(context));
             }
-
+
         }
     }
 
Index: src/com/sun/faces/lifecycle/ELResolverInitPhaseListener.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/lifecycle/ELResolverInitPhaseListener.java,v
retrieving revision 1.1
diff -u -r1.1 ELResolverInitPhaseListener.java
--- src/com/sun/faces/lifecycle/ELResolverInitPhaseListener.java 11
May 2006 18:48:04 -0000 1.1
+++ src/com/sun/faces/lifecycle/ELResolverInitPhaseListener.java 22
May 2006 19:55:20 -0000
@@ -136,7 +136,9 @@
               appAssociate.getFacesELResolverForJsp();
         if (compositeELResolverForJsp == null) {
             if (LOGGER.isLoggable(Level.INFO)) {
-
LOGGER.info("jsf.lifecycle.initphaselistener.resolvers_not_registered");
+ LOGGER.log(Level.INFO,
+
"jsf.lifecycle.initphaselistener.resolvers_not_registered",
+ new Object[] { appAssociate.getContextName() });
             }
             return;
         }
@@ -181,7 +183,9 @@
         }
 
         if (LOGGER.isLoggable(Level.INFO)) {
-
LOGGER.info("jsf.lifecycle.initphaselistener.resolvers_registered");
+ LOGGER.log(Level.INFO,
+
"jsf.lifecycle.initphaselistener.resolvers_registered",
+ new Object[] { appAssociate.getContextName() });
         }
     }