velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Christian <si...@stoutstick.com>
Subject Re: problems with includes
Date Wed, 17 Nov 2004 11:21:51 GMT
Shinobu Kawai wrote:
> Hi christopher,
> 
> 
>>what if i wanted to access another image in a subdir of mine..
>>for example
>>mywebapp
>>   web
>>       META-INF
>>       WEB-INF
>>       templates
>>           images
>>   src
>>   build
>>
>>i want to access the images in the image subdir of the templates directory.
> 
> 
>>>  <img src="http://jakarta.apache.org/velocity/images/logo.gif" />
> 
> Just change the URI in the src attribute to a relative path.  You can
> use the LikeTool to resolve relative paths.
>   http://jakarta.apache.org/velocity/tools/view/LinkTool.html
> 
> You also need to configure your server to process static images, but
> that's usually done by default.  ;)
> 
> Best regards,
> -- Shinobu Kawai
> 

Christopher,

One caveat with this: the images directory shouldn't be within the 
WEB-INF folder at all as this isn't generally externally visible from 
the app server. The final (expanded) app structure could/should look 
something like:

mywebapp
  |- META-INF
  |- WEB-INF
    |- templates
  |- images
  |- scripts

You can then reference images or other resources relative to the templates.

hth

- simon

		


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message