Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4185

MYFACES-4183 causes an issue with getViews

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.0-beta
    • 2.3.0
    • JSR-372
    • None

    Description

      Since the JSFViewDeclarationLanguageStrategy.java always returns true now : https://issues.apache.org/jira/browse/MYFACES-4183

      A issue is now found in the JSPViewDeclarationLanguage.getViews:

      @Override
          public Stream<String> getViews(FacesContext facesContext, String path, int maxDepth, ViewVisitOption... options)
          {
              Stream<String> stream = super.getViews(facesContext, path, maxDepth, options);
              stream = stream.filter(f -> _strategy.handles(f));
              if (options != null &&
                  Arrays.binarySearch(options, ViewVisitOption.RETURN_AS_MINIMAL_IMPLICIT_OUTCOME) >= 0)
              {
                  stream = stream.map(f -> _strategy.getMinimalImplicitOutcome(f));
              }
              return stream;
          }
      

      As you can see from the code above it would be possible to now return views here that are not actually handled specifically by the JSP vdl. For instance in the FaceletViewDeclarationLanguage we have the following filter in place:

      stream = stream.filter(f -> (_strategy.handles(f) && 
                          !FaceletsTemplateMappingUtils.matchTemplate(runtimeConfig, f) ) );
      

      This filter allows us to specify something like the following in the faces-config.xml and avoid returning a view from getViews(), however now it would be returned incorrectly by the JSP vdl:

          <faces-config-extension>
              <facelets-template-mapping>
                  <url-pattern>/templates/*</url-pattern>
              </facelets-template-mapping>
          </faces-config-extension>   
      

      Attachments

        1. MYFACES-4185.patch
          4 kB
          Paul Nicolucci

        Activity

          People

            paul.nicolucci Paul Nicolucci
            paul.nicolucci Paul Nicolucci
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: