Setting idp.home

Brent Putman putmanb at georgetown.edu
Tue Jul 12 12:47:51 EDT 2016



On 7/12/16 4:16 AM, Brent Putman wrote:
>
>
>
> On 7/11/16 11:00 PM, Tom Zeller wrote:
>>
>> Also FWIW, after re-reading the Tomcat docs, I think context.xml can accept <context-param>s to avoid modifying web.xml. But I'm not sure, and plan on giving that a try when I get back to it.
>
> Absolutely it can, I do that routinely. Actually, I'm not sure which
> "context.xml" or <Context> you mean [1], since they can be located in
> various places [2], but:  You can absolutely set/override context
> params for a specific web app completely in the container - meaning
> completely external to the web app - without touching web.xml or
> anything else in the war at all.  You do that by putting the params
> in the external <Context> deployment fragment, such as we document as
> conf/Catalina/localhost/idp.xml [3].    The syntax there is not quite
> the same as web.xml; instead it's <Parameter> elements [4].  But it
> absolutely it works, I've been doing it for probably a decade.

In case someone wants an example, here is the actual context deployment
fragment from a production app I have.  I'm externally setting a
context param (which in this case customizes the Spring root web app
context resources to add in an external beans file in addition to the
default applicationContext.xml)

The 'override' attrib is a little counter-intuitive IMHO.  Setting
'false' means don't allow any the like-named context param value which
may be in web.xml to override the one being set here in the context
deployment element (which is the opposite of what my brain would think
of as natural). IIRC it defaults to true, which means the web.xml value
takes precedence over the externally defined context descriptor value
(which again seems backwards to me, but oh well).


<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="/var/tomcat/gartner/manual-deploy/gartner.war"
         privileged="true" antiResourceLocking="false"
antiJARLocking="false">

  <Parameter name="contextConfigLocation"
value="/WEB-INF/applicationContext.xml
file:///etc/gartner/gartner-spring.xml" override="false"/>

</Context>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20160712/2ede1991/attachment.html>


More information about the users mailing list