I am setting up Virtual Hosts. In my server.xml I have entries like
<Server ...>
<Service ...>
<Engine...>
...
<Host name="sample1" appBase="SampleApps1"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"/>
<Host name="sample2" appBase="SampleApps2"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"/>
...
</Engine>
</Service>
</Server>
Each of the Virtual Hosts will have one or more Contexts. I am concerned about
the Context declaration for my Web Application which is nested in the directory
structure under $CATALINA_HOME/conf.
I am setting this up so that each virtual host shares the same document base
(i.e., it is the same application in different contexts). Each virtual host
has a root.xml that looks something like
<?xml version='1.0' encoding='utf-8'?>
<Context displayName="sample1" docBase="../SciHealthDocBase" path=""
workDir="work/Catalina/sample1/_">
<Parameter name="ClientName" value="Doc" override="false"/>
<Parameter name="AppBase" value="../SampleApps1/" override="false"/>
</Context>
The getRealPath() method of my ServletContext gives me paths relative to my
docBase. I need a way to access directories within my appBase so that I can
place dynamically created content within those directories. I am doing this
right now by defining a Context Parameter that has a relative path hard coded.
Not so bad but I have to make sure I modify this file correctly for each
virtual host setup.
Since the Context declaration is being loaded as part of a Virtual Host I was
hoping to be able to refer to the appBase attribute of the Host entry to make
my Context declaration more robust.
Thanks,
John
CIO
SciHealth
2700 Northeast Expressway, Ste C-200
Atlanta, GA 30345
-----Original Message-----
From: André Warnier [mailto:[email protected]]
Sent: Thursday, February 19, 2009 11:15 AM
To: Tomcat Users List
Subject: Re: Refereing to a Container Attribute in a Nested Container
John Shilling wrote:
> In particular, in my Context element I would like to create a Parameter
> element where the value of the "value" attribute is the "appBase"
> attribute of the Host element containing this Context.
>
Can you kind of "unwind" that sentence, or provide an example, so that
we mere mortals would understand what you mean ?
;-)
---------------------------------------------------------------------
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]