You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Vjeran Marcinko (JIRA)" <ta...@jakarta.apache.org> on 2005/09/21 09:24:30 UTC

[jira] Created: (TAPESTRY-655) ClasspathAssetFactory assumes that passed base resource is ClasspathResource

ClasspathAssetFactory assumes that passed base resource is ClasspathResource
----------------------------------------------------------------------------

         Key: TAPESTRY-655
         URL: http://issues.apache.org/jira/browse/TAPESTRY-655
     Project: Tapestry
        Type: Bug
  Components: Framework  
    Versions: 4.0    
    Reporter: Vjeran Marcinko


When one wants to reference "classpath:" asset, BUT inside specification that is specified as "context:" base resource, ClasspathResourceFactory assumes that passed baseResource is of same "classpath" prefix.

Thsi is frequent case when foo.application is located under /WEB-INF ("context:" base resource), and page's specification path is specified with "classpath:" inside <page> element.

Here is snippet from ClasspathResourceFactory :

    public IAsset createAsset(Resource baseResource, String path, Locale locale, Location location)
    {
        Resource asset = baseResource.getRelativeResource(path);
        Resource localized = asset.getLocalization(locale);
        .......
        return new PrivateAsset((ClasspathResource) localized, _assetService, location);
    }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Updated: (TAPESTRY-655) In some circumstances, using the classpath: or context: prefixes on paths fails to work

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-655?page=all ]

Howard M. Lewis Ship updated TAPESTRY-655:
------------------------------------------

    Summary: In some circumstances, using the classpath: or context: prefixes on paths fails to work  (was: ClasspathAssetFactory assumes that passed base resource is ClasspathResource)

> In some circumstances, using the classpath: or context: prefixes on paths fails to work
> ---------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-655
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-655
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>     Reporter: Vjeran Marcinko
>     Assignee: Howard M. Lewis Ship

>
> When one wants to reference "classpath:" asset, BUT inside specification that is specified as "context:" base resource, ClasspathResourceFactory assumes that passed baseResource is of same "classpath" prefix.
> Thsi is frequent case when foo.application is located under /WEB-INF ("context:" base resource), and page's specification path is specified with "classpath:" inside <page> element.
> Here is snippet from ClasspathResourceFactory :
>     public IAsset createAsset(Resource baseResource, String path, Locale locale, Location location)
>     {
>         Resource asset = baseResource.getRelativeResource(path);
>         Resource localized = asset.getLocalization(locale);
>         .......
>         return new PrivateAsset((ClasspathResource) localized, _assetService, location);
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Closed: (TAPESTRY-655) In some circumstances, using the classpath: or context: prefixes on paths fails to work

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-655?page=all ]
     
Howard M. Lewis Ship closed TAPESTRY-655:
-----------------------------------------

    Fix Version: 4.0
     Resolution: Fixed

This was a very, very tough fix. The ambiguities (inherited from prior versions of Tapestry) have made it very hard to know when you want to evaulate relative to the context root (i.e., for assets) and when you want to evaluate relative to the specification (i.e., resolving a page specification path relative to the application specification).  Further ... what does a relative classpath: path mean when the specification is in the context?  I'm not sure.

In some cases, you may have to change a Tapestry 3.0 <context-asset> to include a leading slash on the path.

> In some circumstances, using the classpath: or context: prefixes on paths fails to work
> ---------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-655
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-655
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>     Reporter: Vjeran Marcinko
>     Assignee: Howard M. Lewis Ship
>      Fix For: 4.0

>
> When one wants to reference "classpath:" asset, BUT inside specification that is specified as "context:" base resource, ClasspathResourceFactory assumes that passed baseResource is of same "classpath" prefix.
> Thsi is frequent case when foo.application is located under /WEB-INF ("context:" base resource), and page's specification path is specified with "classpath:" inside <page> element.
> Here is snippet from ClasspathResourceFactory :
>     public IAsset createAsset(Resource baseResource, String path, Locale locale, Location location)
>     {
>         Resource asset = baseResource.getRelativeResource(path);
>         Resource localized = asset.getLocalization(locale);
>         .......
>         return new PrivateAsset((ClasspathResource) localized, _assetService, location);
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Commented: (TAPESTRY-655) In some circumstances, using the classpath: or context: prefixes on paths fails to work

Posted by "Vjeran Marcinko (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-655?page=comments#action_12330253 ] 

Vjeran Marcinko commented on TAPESTRY-655:
------------------------------------------

As answer to your question - "what does a relative classpath: path mean when the specification is in the context?" 
IMO, some exception should be raised in such cases when relative path is not of same type as base resource, thus user should take care of specifying absolute one.

> In some circumstances, using the classpath: or context: prefixes on paths fails to work
> ---------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-655
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-655
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>     Reporter: Vjeran Marcinko
>     Assignee: Howard M. Lewis Ship
>      Fix For: 4.0

>
> When one wants to reference "classpath:" asset, BUT inside specification that is specified as "context:" base resource, ClasspathResourceFactory assumes that passed baseResource is of same "classpath" prefix.
> Thsi is frequent case when foo.application is located under /WEB-INF ("context:" base resource), and page's specification path is specified with "classpath:" inside <page> element.
> Here is snippet from ClasspathResourceFactory :
>     public IAsset createAsset(Resource baseResource, String path, Locale locale, Location location)
>     {
>         Resource asset = baseResource.getRelativeResource(path);
>         Resource localized = asset.getLocalization(locale);
>         .......
>         return new PrivateAsset((ClasspathResource) localized, _assetService, location);
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Assigned: (TAPESTRY-655) ClasspathAssetFactory assumes that passed base resource is ClasspathResource

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-655?page=all ]

Howard M. Lewis Ship reassigned TAPESTRY-655:
---------------------------------------------

    Assign To: Howard M. Lewis Ship

> ClasspathAssetFactory assumes that passed base resource is ClasspathResource
> ----------------------------------------------------------------------------
>
>          Key: TAPESTRY-655
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-655
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>     Reporter: Vjeran Marcinko
>     Assignee: Howard M. Lewis Ship

>
> When one wants to reference "classpath:" asset, BUT inside specification that is specified as "context:" base resource, ClasspathResourceFactory assumes that passed baseResource is of same "classpath" prefix.
> Thsi is frequent case when foo.application is located under /WEB-INF ("context:" base resource), and page's specification path is specified with "classpath:" inside <page> element.
> Here is snippet from ClasspathResourceFactory :
>     public IAsset createAsset(Resource baseResource, String path, Locale locale, Location location)
>     {
>         Resource asset = baseResource.getRelativeResource(path);
>         Resource localized = asset.getLocalization(locale);
>         .......
>         return new PrivateAsset((ClasspathResource) localized, _assetService, location);
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org