velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Stevens <...@latchkey.com>
Subject Re: singleton Velocity engine
Date Wed, 04 Jul 2001 22:43:30 GMT
One solution for this is to load each instance of Velocity in its own
classloader. That way, within the same ServletContext, you will still have a
unique instance of Velocity. The controller servlet that you use can
differentiate between the different applications within the context by
something like the domain name and you can therefore have a mapping of
something like this:

ie:

ServletContext => root
    classloader1 => app1.domain.com
    classloader2 => app2.domain.com
    classloader3 => app1.foo.com

URI's would look like this:

http://app1.domain.com/root/servlet/ControllerServlet
http://app2.domain.com/root/servlet/ControllerServlet
http://app1.foo.com/root/servlet/ControllerServlet

All of the domains can be mapped to the same Context.

It should be relatively easy to implement this and would solve the problem
right away.

-jon


Mime
View raw message