Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      136

      Description

      If running in an 'older' JSP container, LifecycleImpl throws a
      NullPointerException when registering ELResolvers. This is because the
      CompositeELResolver was never set on the ApplicationAssociate by the
      ConfigureListener.

      The method that sets the CompositeELResolver on the ApplicationAssociate will
      properly exit if it's not running in a JSP 2.1 container (thanks btw), but we
      need to guarantee that the JSFCompositeELResolver first gets set on the
      ApplicationAssociate.

      I'm submitting a patch that just involves moving the JSFCompositeELResolver
      declaration above the JSP 2.1 integration code. This corrected the issue and
      Facelets is able to run in JSP 1.2.

        Activity

        Hide
        jhook added a comment -

        Jayashri, after I had a chance to talk with you at J1, I'm okay with your patch,
        I would just flip the 'if' check you added to avoid an early return so the
        application-scoped variable is always set.

        if (jsp2.1)

        { // do el stuff }

        else

        { // log warning }

        applicationScope.put(KEY, Boolean.TRUE);

        It's not as big of an issue as I thought it was, but it would be nice to put
        ELResolver logic in one spot instead of 2 or 3 (low priority).

        Show
        jhook added a comment - Jayashri, after I had a chance to talk with you at J1, I'm okay with your patch, I would just flip the 'if' check you added to avoid an early return so the application-scoped variable is always set. if (jsp2.1) { // do el stuff } else { // log warning } applicationScope.put(KEY, Boolean.TRUE); It's not as big of an issue as I thought it was, but it would be nice to put ELResolver logic in one spot instead of 2 or 3 (low priority).
        Hide
        jayashri added a comment -

        Thats exactly what I did. Here is the diff.

        • ApplicationAssociate appAssociate =
        • ApplicationAssociate.getInstance(context.getExternalContext());
        • synchronized(this) {
          +
          + synchronized(applicationMap) {
          requestServiced = (String)
          applicationMap.get(this.FIRST_REQUEST_SERVICED);
          if (requestServiced == null)
          Unknown macro: {+ // this needs to be set irrespective whether the FacesResolvers+ // are added to compositeELResolverForJsp or not.+ applicationMap.put(this.FIRST_REQUEST_SERVICED, "true");++ ApplicationAssociate appAssociate =+ ApplicationAssociate.getInstance(context.getExternalContext()); CompositeELResolver compositeELResolverForJsp = appAssociate.getFacesELResolverForJsp(); if (compositeELResolverForJsp == null) { @@ -381,7 +390,7 @@ compositeELResolverForJsp.add((ELResolver) it.next()); } }
        • applicationMap.put(this.FIRST_REQUEST_SERVICED, "true");
        Show
        jayashri added a comment - Thats exactly what I did. Here is the diff. ApplicationAssociate appAssociate = ApplicationAssociate.getInstance(context.getExternalContext()); synchronized(this) { + + synchronized(applicationMap) { requestServiced = (String) applicationMap.get(this.FIRST_REQUEST_SERVICED); if (requestServiced == null) Unknown macro: {+ // this needs to be set irrespective whether the FacesResolvers+ // are added to compositeELResolverForJsp or not.+ applicationMap.put(this.FIRST_REQUEST_SERVICED, "true");++ ApplicationAssociate appAssociate =+ ApplicationAssociate.getInstance(context.getExternalContext()); CompositeELResolver compositeELResolverForJsp = appAssociate.getFacesELResolverForJsp(); if (compositeELResolverForJsp == null) { @@ -381,7 +390,7 @@ compositeELResolverForJsp.add((ELResolver) it.next()); } } applicationMap.put(this.FIRST_REQUEST_SERVICED, "true");
        Hide
        jayashri added a comment -

        Fix checked in. Jacob, can you please verify the fix with Facelets ?
        Thanks

        Show
        jayashri added a comment - Fix checked in. Jacob, can you please verify the fix with Facelets ? Thanks
        Hide
        jayashri added a comment -

        fix checked in

        Show
        jayashri added a comment - fix checked in
        Hide
        Manfred Riem added a comment -

        Closing issue out

        Show
        Manfred Riem added a comment - Closing issue out

          People

          • Assignee:
            jayashri
            Reporter:
            jhook
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: