JB wrote:
Hi everybody,
I'm very new to tapestry and I've a very stupid question about handling
images.
I'm using dreamwaver to edit home.html template.
I've created an img subfolder in WEB-INF directory and i'm referencing
images this way (in dreamweaver)
<img src="img/image1.gif" />
It works great but if I run the page from server
(http://localhost:8080/firstApp/..) all images are not seen.
The reason is that the servlet container is expressly forbidden to show
files in WEB-INF. So if it is to serve static content (like images) they
can not reside in WEB-INF. Assests work differently because Tapestry
loads them and sends them to the client so from the servlet-containers
point of view they are not static content.
I do not know if there is an easy way around this since you have
conflicting requirements, the servlet spec vs. preview of templates. One
way would perhaps (not tested) be to use a base-tag of ".." in the
templates and make sure that this is filtered out when tapestry looks at
the templates (using jwcid="$remove$").
Using assets and @Img component works but I would like to know if there
is a way to use images without the need of an asset for each image.
Actually I've found a workaround making a copy of my img dir outside the
WEB-INF folder (in the root of my context) but I would like to know if
there is a better way.
Regards
JB
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]