You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alan Chandler <al...@chandlerfamily.org.uk> on 2005/08/04 01:16:44 UTC
Confused about paths to assets.
I am building my first component as a stand alone item to ultimately be
packaged up in a jar and stored somewhere. $CATALINA_HOME/shared/lib ?
I'll then want to reference it in several applications I envisage building for
my home web site.
Firstly I am not 100% sure what my directory structure should be. Under
eclipse I have set something along these lines
context
images
styles
WEB-INF
classes
src
Eclipse will populate context/WEB-INF/classes with the compiled java class
from src, and I assume (when I get that far) can create a jar from the
context directory contents.
The image and styles directories will contain assets for use by this
component.
I do NOT (so far at least) have a component specification file because I have
done all the setting of parameter bindings in the html file, and all the
declaration of parameters using the @ annotations in the component class
file.
In the declaration of assets with this sort of combination.
@asset("images/image.png")
public abstract IAsset getThisAsset();
The WEB-INF directory contains my html template file and a properties file
(with some keys/strings for the component to use).
So Questions
1) Is this the right structure for a component that will ultimately become a
library component?
2) Am I using the right path in the @asset annotation in order to correctly
locate the assets stored in the context/images directory. In particular do I
need a leading '/'
3) I actually have an Apache configuration connected via jk_mount to tomcat
and I would like to serve my assets up via Apache.
I know there are two parameters
org.apache.tapestry.asset.dir
and
org.apache.tapestry.asset.URL
If I set the first of these (org.apache.tapestry.asset.dir) to something like
/var/www/chandler
and have the subdirectories of 'images' and 'styles' underneath this directory
and then set the second (org.apache.tapestry.asset.URL) some just a simple /
Then if I have my document root in apache set to /var/www/chandler will
tapestry copy the assets to the /var/www/chandler/images
and /var/www/chandler/styles appropriately and correctly reference the URLs
in the links that use them?
4) Are the above two configuration parameters configured in any application
that uses my component?
--
Alan Chandler
http://www.chandlerfamily.org.uk
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org