On 11/09/17 21:07, Coty Sutherland wrote:
> On Mon, Sep 11, 2017 at 2:43 PM, Mark Thomas <ma...@apache.org> wrote:
>> On 11/09/17 19:07, Coty Sutherland wrote:
>>
>>> So, my questions comes down to "Can I configure a PropertySource
>>> instance and pass that to tomcat's Digester before tomcat starts?".
>>
>> No, because of the way it is currently coded.
> 
> I thought so.
> 
>>> Is this a silly question? If so, why?
>>
>> No. N/A.
>>
>> I can see the benefit in making it configurable.
>>
>> It looks like you'd need something along the lines of an
>> addSource(IntrospectionUtils.PropertySource) method that added to the
>> source array.
> 
> Hm. So I took a look at the Digester and having a way to add the
> source there would be ideal, but I think that only solves the issue of
> having tomcat's internal classes configure it, right? I don't see a
> way to do something like tomcat.setDigester(myDigester) anywhere. As
> far as the digester that loads the server.xml I just see
> o.a.c.startup.Catalina.createStartDigester(). I've only had a second
> to look at it, but I'd love to figure this out. Hints appreciated :)

I don't think I looked at it for much longer.

You don't want that Digester instance - the Tomcat class doesn't parse
server.xml. You want the equivalent for the Context which is set in
ContextConfig. (or is this for web.xml?)

Take a look at the difference between addWebApp and addContext.

It sounds like you are using addWebApp. In which case maybe a property
source setter on ContextConfig that is then injected into that Digester
instance?

> I guess I should create an enhancement BZ for this?

I think so. There are a few different digester instances. It would be
good to have a solution that handled all likely variations.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to