Hi there,
 
  It seams I do not understand the asset-idea fully. The problem of referencing 
images and scripts in source (e.g for including GWT + Ext components) seams to 
be quite tricky since tapestry uses the path (url) of pages to add additional 
parameters. So I stuck with path issues when using relative paths all day long.
 
Example:
 
relative: <img src="images/png1.png"> - does not work with different parameters 
(/view vs. /view/0)
absolute: <img src="/contextName/images/png1.png"> - works
 
Since hard coding the context name (absolute way) makes the code blow when 
renaming the project I would like to consider it bad style. So using a global 
property (visible to all pages and components) seams the way to go.
 
global: <img src="${contextRoot}/images/png1.png">
 
This context root I can grab from ServletContext via requestGlobals. This would 
polute my components and pages so I am looking for a global property definition 
I can use within the templates just like the "context:" or "${tapestry}" alias. 
Saidly this alias service does not work for templates as far as I know.
 
Is there any way around? I dont like to extend my components and pages just for 
the sake knowing the contextName without injecting request globals every time 
(at least on page level - using inherit for component base parameter).
 
Also I need this base for setting up generated html within a GWT component.
 
 
Thanks,
 
Martin (Kersten)

Reply via email to