velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <piscesone...@yahoo.co.uk>
Subject Re: problems with includes
Date Thu, 18 Nov 2004 18:04:29 GMT
thanks
if i use
 mywebapp
   |- META-INF
   |- WEB-INF
     |- templates
   |- images
   |- scripts

then what do i use in my velocity properties?
this is what i am using now

#
# we are taking advantage of the fact that the file
# resource loader is the default loader
#

resource.loader = webapp
webapp.resource.loader.description = Velocity Webapp Resource Loader
webapp.resource.loader.class =
org.apache.velocity.tools.view.servlet.WebappLoader
webapp.resource.loader.path = /templates

this works with my directory layout. as you can see, i am trying to follow
the directory structure recommend for jarkarta servelets etc

thanks
christopher

----- Original Message ----- 
From: "Simon Christian" <simon@stoutstick.com>
To: "Velocity Users List" <velocity-user@jakarta.apache.org>
Sent: Wednesday, November 17, 2004 7:21 AM
Subject: Re: problems with includes


> 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
>


---------------------------------------------------------------------
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