On Fri, Aug 16, 2013 at 12:19 PM, Harry Metske <[email protected]> wrote:
>
> indeed , tomcat has no option to have webapp specific classloading and
> therefore it is war surgery.
> Other appservers might have, for example WebSphere has so called shared
> libraries that can be assigned to one or more applications, so you can have
> different configurations for multiple wiki's without war-surgery.

You can have webapp specific system properties in Tomcat. Currently, I
have 5 separate JSPWiki instances in the same Tomcat instance, all
running from the same JSPWiki WAR, but each with a specific property
file.

I'm still using 2.10.0-svn-10, so this is from before the recent
property changes. I'm using Tomcat 7.0.42, but I believe this was
already working in Tomcat 6.

In the Tomcat conf/Catalina/localhost directory, I have five "Context"
XML files (one per JSPWiki instance). They all follow the same simple
pattern. For example, here's my Perso.xml context file, which creates
a "Perso" JSPWiki instance (accessible from
http://<tomcat:port>/Perso/):

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="F:/app/jspwiki-2.10.0-svn-10" swallowOutput="true">
    <Parameter override="false"
        name="jspwiki.propertyfile"
        value="F:/app/jspwiki-2.10.0-svn-10/WEB-INF/jspwiki-common.properties"/>
    <Parameter override="false"
        name="jspwiki.propertyfile.cascade.1"
        value="F:/wiki/perso/conf/override.properties"/>
</Context>

docBase is where I extracted the JSPWiki WAR file
(F:/app/jspwiki-2.10.0-svn-10 in my case).

Inside the WEB-INF directory of the WAR file, I put a
jspwiki-common.properties file that contains all settings common to
all my JSPWiki instances. This is the jspwiki.propertyfile parameter,
which is the same in all contexts.

Inside a directory dedicated to my Perso JSPWiki instance, I put a
override.properties file that contains the settings specific to the
Perso JSPWiki instance. This is the jspwiki.propertyfile.cascade.1
parameter, which is different in every context.

Once defined in a context file, despite originating from the same WAR,
the web apps behave fully independently from each other. They have
their own work directories, their own sessions, etc.

Regards,

Adrien

Reply via email to