Tapestry
  1. Tapestry
  2. TAPESTRY-2519

Make ClassNameLocatorImpl resolve resources from URLs that use a client-defined protocol

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.14
    • Fix Version/s: 5.0.14
    • Component/s: None
    • Labels:
      None

      Description

      ClassNameLocatorImpl is only able to resolve resources from URLs that use a protocol which is native to the Java class library (file, jar, http, etc). In OSGi environment all the URLs use the protocol "bundleresource" or "bundleentry". Here is an example:

      bundleresource://5642/org/apache/tapestry5/corelib/pages/

      A very simple solution is to create your own ClassNameLocator and contribute it to AliasOverrides. Well, this solution is bad because it requires a copy of the ClassNameLocatorImpl.

      A better solution would be to make ClassNameLocatorImpl use a service called URLConverter or similar.

      public interface URLConverter
      {
      URL convert(URL url);
      }

      Tapestry would provide a default implementation of the interface:

      public class URLConverterImpl implements URLConverter
      {
      public URL convert(URL url)

      { return url; }

      }

      In an OSGi environment (in my case Equinox) one could override this service by using e.g Eclipse Core API. This approach is much easier then overriding of the ClassNameLocator.

        Activity

        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12568044 ] jira [ 12590018 ]
        Mark Thomas made changes -
        Workflow jira [ 12435214 ] Default workflow, editable Closed status [ 12568044 ]
        Howard M. Lewis Ship made changes -
        Fix Version/s 5.0.14 [ 12313214 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Assignee Igor Drobiazko [ igor.drobiazko ] Howard M. Lewis Ship [ hlship ]
        Igor Drobiazko created issue -

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Igor Drobiazko
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development