Tapestry
  1. Tapestry
  2. TAPESTRY-1091

Invalid URL for injected using annotation assets

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.2
    • Fix Version/s: 4.1.2
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      I'm creating component and use new Annotation approach to configure component specification. When tapesrty perform enhansements to inject declared assets it create instance of org.apache.hivemind.util.ClasspathResource class for resolving relative to component class resources. Thih method incorrect translate class name to resource path. In current implementation path computed as clazz.getName().replace('.', '/')
      But i believe that it cold be prepended by "/". Without this slash all components assets pathes resolved without leading slash to, so final assets url looked as

      – in simple case
      /test-app/app?digest=0548e5fdfa94cce3bfbe04c23709b124&path=components%2Fpc%2FPeriodChooser.js&service=asset
      – in case of using friendly urls feature
      /test-app/assets/0548e5fdfa94cce3bfbe04c23709b124components/pc/PeriodChooser.js

      in first case AssetsService can load resource for this path. but in case of using friendly urls AssetsEncode? cold not decode incorrect url and asset is not accessible.

      I think whe cold change method org.apache.tapestry.annotations.AnnotationEnhancementWorker.newClassResource(Class clazz) form
      private ClasspathResource newClassResource(Class clazz)
      {
      return new ClasspathResource(_classResolver, clazz.getName().replace('.', '/'));
      }
      to

      private ClasspathResource newClassResource(Class clazz)
      {
      return new ClasspathResource(_classResolver, '/' + clazz.getName().replace('.', '/'));
      }

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Jesse Kuhnert
              Reporter:
              Alexander Gavrilov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development