I think that depends on which kind of Velocity engine you are using/
which pre-fabricated Velocity servlet you are using.

If it is using the Singleton model velocity engine, then there is only
one velocity engine for each velocity .jar file.  If there is a
separate Velocity configuration for each application in the servlet
container, then each WEB-INF/lib needs its own velocity .jar.

If your servlet is using the VelocityEngine object, then the velocity
.jar will keep tract of the separate configurations of each
VelocityEngine object, and multiple configurations coexist peacefully.
In this case, you can include the velocity .jar in a directory that is
shared by all applications.

Right now, I believe most of the Velocity convenience servlets are
using the Singleton model.  Hopefully, that will change.  I have
written my own servlet extending HttpServlet which uses the
VelocityEngine object.

Barbara Baughman
X2157

On Thu, 20 Jan 2005, Will Glass-Husain wrote:

> What problems?  Can you be a bit more specific?
>
> Again, you have a choice.  You can put the Velocity jar either in
> Tomcat/common/lib, or in WEB-INF/lib.  With the latest set of source code,
> you can then put the the templates at the WEB-APP level or (if the velocity
> jar is at the container level) in the container level.  This will be
> released in version 1.5.
>
> With version 1.4, you had to always put the templates in the same level as
> the velocity jar.
>
> WILL
>
> ----- Original Message -----
> From: "Carfield Yim" <[EMAIL PROTECTED]>
> To: "Velocity Users List" <[email protected]>
> Sent: Thursday, January 20, 2005 9:35 AM
> Subject: Re: Classloading problem of using velocity with tomcat
>
>
> > On Thu, 20 Jan 2005 08:45:06 -0800, Will Glass-Husain <[EMAIL PROTECTED]>
> > wrote:
> >> Hi Carfield,
> >>
> >> You can't set the ClassLoader.  Velocity looks for the resources in the
> >> Thead.getContextClassLoader, or the system one (if not found)
> >>
> >> Typical practice:
> >>
> >> Put the velocity jar either in your WEB-INF/lib or the container lib.
> >>
> >> Put your classes in WEB-INF/classes, or in a jar file in WEB-INF/jar.
> >>
> > I personally does, but I can't tell allll our clients do so, so of
> > they will deploy our application to more than 1 instance at
> > webcontainer for various reasons. They will like to place to library
> > at tomcat common directory in order to update the library more easier.
> >
> > Besides, are you mean that even if I upgrade velocity to new version,
> > the problem will persist?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to