> Mark,
> 
> On 10/16/19 04:41, Mark Thomas wrote:
>>> On 10/15/19 09:37, Mark Thomas wrote:

<snip/>

>>> Isn't there a magic ${property} that can be used to mean "the
>>> context's root" so you don't have to use ${catalina.base}
>>> instead? I browsed  through the document a bit and didn't find
>>> anything, but I could swear it's been discussed in the past.
> 
>> There has been some discussion about exposing the context name via
>> additional routes but I don't remember anything specific about the
>> context root - apart from various discussions around getRealPath()
>> and not being able to assume that any web app maps to a location on
>> a file system.
> 
> Right, getRealPath is the badness.
> 
> But! Since all resource loading in Tomcat now goes through the
> resources framework, perhaps "${context-root}" could use a proper
> protocol that isn't "file:///" and point to the right place?

Well, the server.xml parsing should accept URLs anywhere you can specify
a file (assuming we've hooked up everything correctly) so you could
probably have ${context-root} return the result of
WebResourceRoot.getResource("/").getURL()

However...

That is only going to work *after* the web application has started but
you need it *before* the app starts to use it in context.xml.

I think this might end up being one of those cases where using
${catalina.base} is the better approach.

Mark

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

Reply via email to