|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@UsesMappedConfiguration(value=java.lang.String.class) public interface ClasspathAssetAliasManager
Used as part of the support for classpath Asset
s, to convert the Asset's
Resource
to a URL that can be accessed by the client. The asset path, within the
classpath, is converted into a shorter virtual path. The term "alias" here is generally referred to as
"virtual folder" elsewhere.
mylib
to com/example/mylib
.
As originally envisioned, this service would simply optimize classpath assets, allowing the URL path for such assets to be shortened (and have a version number added, important for caching); thus the word "alias" makes sense ... it was responsible for creating an "alias" URL shorter than the default "classpath" URL.
Starting in Tapestry 5.2, this changed; all classpath assets must be "aliased" to a shorter URL path. Any URL that can not be shortened is now rejected. This simplifies creating new libraries, but also helps with security concerns, as it limits which portions of the classpath can ever be exposed to the user agent.
Tapestry automatically contributes a number of mappings: for the application root package itself (as alias "app") and
for each library (via ComponentClassResolver.getFolderToPackageMapping()
);
Method Summary | |
---|---|
Map<String,String> |
getMappings()
Returns the mappings used by the service: the keys are the folder aliases (i.e, "corelib") and the values are the corresponding paths (i.e., "org/apache/tapestry5/corelib"). |
String |
toClientURL(String resourcePath)
Takes a resource path to a classpath resource and adds the asset path prefix to the path. |
Method Detail |
---|
String toClientURL(String resourcePath)
resourcePath
- resource path on the classpath (with no leading slash)
Map<String,String> getMappings()
ClasspathAssetRequestHandler
s can be created automatically
for each mapping.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |