dev@javaserverfaces.java.net

Re: Review: Fix for JSFRI issue 129

From: Ed Burns <ed.burns_at_sun.com>
Date: Wed, 15 Jun 2005 10:54:14 -0700

>>>>> On Tue, 14 Jun 2005 17:19:54 -0700, Jayashri Visvanathan <Jayashri.Visvanathan_at_Sun.COM> said:

JV> Please review the fix for JSFRI issue 129 posted at
JV> https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=129

JV> of the entire stack.

JV> M com/sun/faces/lifecycle/LifecycleImpl.java
JV> add a method to populate the FacesELResolver stack during the
JV> very first time a request is processed.

This lacks the concurrency controls we discussed. How about this instead:

@@ -80,7 +95,13 @@
         if (log.isDebugEnabled()) {
             log.debug("execute(" + context + ")");
         }
-
+
+ // Register ElContextListenerImpl with JSP so that it can be
+ // notified when a ELContext is created as well as
+ // FacesCompositeELResolver with JSP. This needs to be done right after
+ // the first request is serviced.

if
(!context.getExternalContext().getApplicationMap().containsKey(FIRST_REQUEST_SERVICED))
{
  synchronized (this) {
+ populateFacesELResolverForJsp(context);
  }
  catch (InterruptedException e) {
    //...
  }+
       
         for (int i = 1; i < phases.length; i++) { // Skip ANY_PHASE placeholder
 
             if (context.getRenderResponse() ||
@@ -288,6 +309,69 @@

And remove the synchronized block from inside
populpateFacesELResolverForJsp(). You need to check the key twice, once
before aquiring the lock, and again after (inside the populate()
method).

Ed

-- 
| ed.burns_at_sun.com  | {home: 407 869 9587, office: 408 884 9519 OR x31640}
| homepage:         | http://purl.oclc.org/NET/edburns/
| aim: edburns0sunw | iim: ed.burns_at_sun.com