Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.2
    • Component/s: Facelets/VDL
    • Labels:
      None

      Description

      We need a way to declare a ResourceResolver without XML.

      1. changebundle.txt
        10 kB
        Ed Burns
      2. diffs.patch
        2 kB
        Ed Burns

        Issue Links

          Activity

          Ed Burns created issue -
          Ed Burns made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          Ed Burns made changes -
          Hide
          Ed Burns added a comment -

          Adding jsf-api/src/main/java/javax/faces/view/facelets/FaceletsResourceResolver.java
          Transmitting file data .
          Committed revision 9400.

          Still need to implement

          Show
          Ed Burns added a comment - Adding jsf-api/src/main/java/javax/faces/view/facelets/FaceletsResourceResolver.java Transmitting file data . Committed revision 9400. Still need to implement
          Hide
          Ed Burns added a comment -

          Fix in progress. Incomplete.

          Show
          Ed Burns added a comment - Fix in progress. Incomplete.
          Ed Burns made changes -
          Attachment diffs.patch [ 47558 ]
          Hide
          Ed Burns added a comment -

          in progress, need test before commit

          Show
          Ed Burns added a comment - in progress, need test before commit
          Ed Burns made changes -
          Attachment changebundle.txt [ 47563 ]
          Hide
          Ed Burns added a comment -

          Sending jsf-ri/src/main/java/com/sun/faces/application/ApplicationAssociate.java
          Sending jsf-ri/src/main/java/com/sun/faces/config/AnnotationScanner.java
          Sending jsf-ri/src/main/java/com/sun/faces/facelets/util/ReflectionUtil.java
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/build.xml
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/pom.xml
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/java
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/java/com
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/java/com/sun
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/java/com/sun/faces
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/java/com/sun/faces/regression
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/java/com/sun/faces/regression/i_spec_1038_war
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/java/com/sun/faces/regression/i_spec_1038_war/AnnotationDeclaredResourceResolver.java
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/webapp
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/webapp/WEB-INF
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/webapp/WEB-INF/beans.xml
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/webapp/WEB-INF/web.xml
          Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-1038/i_spec_1038_war/src/main/webapp/i_spec_1038_war.xhtml
          Transmitting file data .........
          Committed revision 9401.

          Show
          Ed Burns added a comment - Sending jsf-ri/src/main/java/com/sun/faces/application/ApplicationAssociate.java Sending jsf-ri/src/main/java/com/sun/faces/config/AnnotationScanner.java Sending jsf-ri/src/main/java/com/sun/faces/facelets/util/ReflectionUtil.java Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /build.xml Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/pom.xml Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/java Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/java/com Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/java/com/sun Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/java/com/sun/faces Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/java/com/sun/faces/regression Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/java/com/sun/faces/regression/i_spec_1038_war Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/java/com/sun/faces/regression/i_spec_1038_war/AnnotationDeclaredResourceResolver.java Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/webapp Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/webapp/WEB-INF Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/webapp/WEB-INF/beans.xml Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/webapp/WEB-INF/web.xml Adding jsf-test/ JAVASERVERFACES_SPEC_PUBLIC-1038 /i_spec_1038_war/src/main/webapp/i_spec_1038_war.xhtml Transmitting file data ......... Committed revision 9401.
          Ed Burns made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 2.2 [ 10403 ]
          Resolution Fixed [ 1 ]
          Hide
          arjan tijms added a comment -

          I have a question about the implementation. Currently it's:

          ApplicationAssociate#createFaceletFactory
          Set<? extends Class> resourceResolvers = 
              ConfigManager.getAnnotatedClasses(ctx).get(FaceletsResourceResolver.class);
          if ((null != resourceResolvers) && !resourceResolvers.isEmpty()) {
              Class resolverClass = resourceResolvers.iterator().next();
              if (1 < resourceResolvers.size()) {
                  if (LOGGER.isLoggable(Level.SEVERE)) {
                      LOGGER.log(Level.SEVERE, "Found more than one class " + 
                          "annotated with FaceletsResourceResolver.  Will " + 
                          "use {0} and ignore the others", resolverClass);
                  }
              }
              resolver = (ResourceResolver) 
                  ReflectionUtil.decorateInstance(resolverClass,
                  ResourceResolver.class,
                  resolver);
          } else {
              String resolverName = webConfig.getOptionValue(FaceletsResourceResolver);
              if (resolverName != null && resolverName.length() > 0) {
                  resolver = (ResourceResolver) 
                          ReflectionUtil.decorateInstance(resolverName,
                          ResourceResolver.class,
                          resolver);
              }
          }
          

          So if the @FaceletsResourceResolver annotation is present, it's used. Otherwise the XML is consulted.

          Should this perhaps not be the other way around? In Java EE it seems to be the convention that XML can be used to override annotations. Is there a hard rule for this somewhere?

          A small other thing; I noticed that in com.sun.faces.config.AnnotationScanner the Javadoc on top of the class has not been updated for the newly added annotation.

          Show
          arjan tijms added a comment - I have a question about the implementation. Currently it's: ApplicationAssociate#createFaceletFactory Set<? extends Class > resourceResolvers = ConfigManager.getAnnotatedClasses(ctx).get(FaceletsResourceResolver.class); if (( null != resourceResolvers) && !resourceResolvers.isEmpty()) { Class resolverClass = resourceResolvers.iterator().next(); if (1 < resourceResolvers.size()) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, "Found more than one class " + "annotated with FaceletsResourceResolver. Will " + "use {0} and ignore the others" , resolverClass); } } resolver = (ResourceResolver) ReflectionUtil.decorateInstance(resolverClass, ResourceResolver.class, resolver); } else { String resolverName = webConfig.getOptionValue(FaceletsResourceResolver); if (resolverName != null && resolverName.length() > 0) { resolver = (ResourceResolver) ReflectionUtil.decorateInstance(resolverName, ResourceResolver.class, resolver); } } So if the @FaceletsResourceResolver annotation is present, it's used. Otherwise the XML is consulted. Should this perhaps not be the other way around? In Java EE it seems to be the convention that XML can be used to override annotations. Is there a hard rule for this somewhere? A small other thing; I noticed that in com.sun.faces.config.AnnotationScanner the Javadoc on top of the class has not been updated for the newly added annotation.
          Hide
          Ed Burns added a comment -

          Good questions by arjan tims have prompted me to reopen this.

          Show
          Ed Burns added a comment - Good questions by arjan tims have prompted me to reopen this.
          Ed Burns made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Ed Burns added a comment -

          Spec changes.

          Sending preface.fm
          Sending usingFacesInWebapps.fm
          Transmitting file data ..
          Committed revision 1041.

          Sending jsf-ri/src/main/java/com/sun/faces/application/ApplicationAssociate.java
          Sending jsf-ri/src/main/java/com/sun/faces/config/AnnotationScanner.java
          Transmitting file data ..
          Committed revision 9407.

          Show
          Ed Burns added a comment - Spec changes. Sending preface.fm Sending usingFacesInWebapps.fm Transmitting file data .. Committed revision 1041. Sending jsf-ri/src/main/java/com/sun/faces/application/ApplicationAssociate.java Sending jsf-ri/src/main/java/com/sun/faces/config/AnnotationScanner.java Transmitting file data .. Committed revision 9407.
          Ed Burns made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Ed Burns added a comment -

          I don't know what the difference between "close" and "resolve" is so I am doing both.

          Show
          Ed Burns added a comment - I don't know what the difference between "close" and "resolve" is so I am doing both.
          Ed Burns made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          arjan tijms added a comment -

          Per commit 9755 and issues JAVASERVERFACES_SPEC_PUBLIC-719 and JAVASERVERFACES_SPEC_PUBLIC-809, ResourceResolver has been deprecated.

          Perhaps it's a little confusing if a new annotation is introduced for something that is simultaneously deprecated?

          Show
          arjan tijms added a comment - Per commit 9755 and issues JAVASERVERFACES_SPEC_PUBLIC-719 and JAVASERVERFACES_SPEC_PUBLIC-809 , ResourceResolver has been deprecated. Perhaps it's a little confusing if a new annotation is introduced for something that is simultaneously deprecated?

            People

            • Assignee:
              Ed Burns
              Reporter:
              Ed Burns
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 1 day
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified