javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-611

Export FaceletFactory as a standard artifact vended from FactoryFinder.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.0
    • Fix Version/s: 2.2
    • Component/s: Facelets/VDL
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      611
    • Status Whiteboard:
      Hide

      cat2 javadoc size_medium importance_medium

      Show
      cat2 javadoc size_medium importance_medium

      Description

      It would probably be useful for developers that wish to provide custom
      functionality within the FaceletFactory to be able to do so in a standard fashion.

      FactoryFinder.FACELET_FACTORY seems to be the logical place to expose such an
      extension point.

      1. 20110914_i_spec_611.patch
        50 kB
        Ed Burns
      2. 20121109-1746-i_spec_611.patch
        14 kB
        Ed Burns
      3. changebundle.txt
        60 kB
        Ed Burns

        Activity

        Hide
        jasonzhang2002gmailcom added a comment -

        Leave it as it is in 2.1 is good. At least I have a way to look up FaceletFactory.
        On the other hand, FaceletFactory provides many useful features which are essential sometime. It will be good to expose it and let the user to use it as his own risk.

        Show
        jasonzhang2002gmailcom added a comment - Leave it as it is in 2.1 is good. At least I have a way to look up FaceletFactory. On the other hand, FaceletFactory provides many useful features which are essential sometime. It will be good to expose it and let the user to use it as his own risk.
        Hide
        betermieux added a comment -

        I have slept over the issue and rethought about Leonardo's comments. Most of his concerns are about creating Components using the FaceletFactory. I am fine with restoring 2.1 functionality and writing some words of warning in javadoc. As Jason stated, there are many more uses of a custom FaceletFactory, which should not be limited without a reason.

        Show
        betermieux added a comment - I have slept over the issue and rethought about Leonardo's comments. Most of his concerns are about creating Components using the FaceletFactory. I am fine with restoring 2.1 functionality and writing some words of warning in javadoc. As Jason stated, there are many more uses of a custom FaceletFactory, which should not be limited without a reason.
        Hide
        Frank Caputo added a comment -

        Restoring 2.1 behavior would be fine.

        Show
        Frank Caputo added a comment - Restoring 2.1 behavior would be fine.
        Hide
        jasonzhang2002gmailcom added a comment -

        I checked that FaceletFactory is not in the official 2.2 release. There is no way to create a component from a xhtml fragment. For example, I have a resource.xhtml using ui:compoonent. I would like to turn it into a component. Clearly Application.createComponent(FacesContext, Resource) is only useful for composite component, but I need a approach to create simple component.

        Show
        jasonzhang2002gmailcom added a comment - I checked that FaceletFactory is not in the official 2.2 release. There is no way to create a component from a xhtml fragment. For example, I have a resource.xhtml using ui:compoonent. I would like to turn it into a component. Clearly Application.createComponent(FacesContext, Resource) is only useful for composite component, but I need a approach to create simple component.
        Hide
        lu4242 added a comment -

        From my point of view, the spec as is in JSF 2.2 should support something like this:

        // Dynamic include
        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put("src", "/addSimpleIncludeVDL_1_1.xhtml");
        UIComponent component = vdl.createComponent(facesContext,
        "http://java.sun.com/jsf/facelets",
        "include", attributes);

        The idea is very simple: if multiple components are inside an xhtml fragment, just return one parent component that wraps everything. If it is just one, return the same component. I made a working prototype in MyFaces some weeks ago about this idea and it works very well, because inside vdl.createComponent(...) it is possible to put the necessary code to make it work programatically, something that just does not work well doing it through FaceletFactory, which I still consider a bad idea.

        I like this approach because it is totally "decoupled" from the underlying vdl implementation.

        Note I don't know if that approach works for Mojarra, or if the original idea has this in mind(I suppose no).

        Show
        lu4242 added a comment - From my point of view, the spec as is in JSF 2.2 should support something like this: // Dynamic include Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put("src", "/addSimpleIncludeVDL_1_1.xhtml"); UIComponent component = vdl.createComponent(facesContext, "http://java.sun.com/jsf/facelets", "include", attributes); The idea is very simple: if multiple components are inside an xhtml fragment, just return one parent component that wraps everything. If it is just one, return the same component. I made a working prototype in MyFaces some weeks ago about this idea and it works very well, because inside vdl.createComponent(...) it is possible to put the necessary code to make it work programatically, something that just does not work well doing it through FaceletFactory, which I still consider a bad idea. I like this approach because it is totally "decoupled" from the underlying vdl implementation. Note I don't know if that approach works for Mojarra, or if the original idea has this in mind(I suppose no).

          People

          • Assignee:
            Ed Burns
            Reporter:
            Ryan Lubke
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours, 36 minutes
              2h 36m