Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.0.2
-
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('.', '/'));
}
Attachments
Issue Links
- is cloned by
-
TAPESTRY-1396 Specless components in libraries don't get their assets properly resolved
- Closed