Responsible for copying assets from the classpath to an external directory that
is visible to the web server. The externalizer is stored inside
the ServletContext as a named attribute.
The externalizer uses the name org.apache.tapestry.AssetExternalizer.application name. It configures itself using two additional
properties (searching in
getPropertySource() .
Parameter
Description
org.apache.tapestry.asset.dir
The directory to which assets will be copied.
org.apache.tapestry.asset.URL
The corresponding URL for the asset directory.
If either of these parameters is null, then no externalization occurs.
Private assets will still be available, just less efficiently, as the application
will be invoked via its servlet and, ultimately, the AssetService will need
to retrieve the asset.
Assets maintain thier directory structure when copied. For example,
an asset with a resource path of /com/skunkworx/Banner.gif would
be copied to the file system as dir/com/skunkworx/Banner.gif and
would have a URL of URL/com/skunkworx/Banner.gif.
The externalizer will create any directories as needed.
The externalizer will not overwrite existing files. When a new version of the application
is deployed with changed assets, there are two deployment stategies:
Delete the existing asset directory and allow the externalizer to recreate and
repopulate it.
Change the asset directory and URL, allowing the old and new assets to exist
side-by-side.
When using the second approach, it is best to use a directory that has
a version number in it, for example, D:/inetpub/assets/0 mapped to the URL
/assets/0. When a new version of the application is deployed, the trailing
version number is incremented from 0 to 1.
The externalizer uses the name
org.apache.tapestry.AssetExternalizer.application name. It configures itself using two additional properties (searching in getPropertySource() .org.apache.tapestry.asset.dirorg.apache.tapestry.asset.URLIf either of these parameters is null, then no externalization occurs. Private assets will still be available, just less efficiently, as the application will be invoked via its servlet and, ultimately, the AssetService will need to retrieve the asset.
Assets maintain thier directory structure when copied. For example, an asset with a resource path of
/com/skunkworx/Banner.gifwould be copied to the file system asdir/com/skunkworx/Banner.gifand would have a URL ofURL/com/skunkworx/Banner.gif.The externalizer will create any directories as needed.
The externalizer will not overwrite existing files. When a new version of the application is deployed with changed assets, there are two deployment stategies:
When using the second approach, it is best to use a directory that has a version number in it, for example,
D:/inetpub/assets/0mapped to the URL/assets/0. When a new version of the application is deployed, the trailing version number is incremented from 0 to 1.