tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Re: Question about context aliases
Date Fri, 23 Apr 2010 09:51:38 GMT
On 22.04.2010 18:51, Mark Thomas wrote:
> On 22/04/2010 17:40, Rainer Jung wrote:
>> Experimenting on the extreme side of things: when trying to use
>> aliases="/=/some/path" I can't get any resource to load:
>>
>> - there is /some/path/test.properties
>> - servletContext().getResourceAsStream("/test.properties") returns null.
>>
>> It works, once I use aliases="/myapp=/some/path" and
>> servletContext().getResourceAsStream("/myapp/test.properties").
>>
>> Is that expected?
>
> Nope. Thats broken.

I see, it was because you need to remove the trailing slash and for "/" 
the trailing slash is the leading one too.

Now using an alias with "/" naively seems to make not much sense (the 
webapps will break unless you move everything there). I thought about 
using slash in order to overwrite stuff. So the expected behaviour for 
an alias using "/" would be to only use the alias results, if something 
was actually found under the alias.

I prepared a patch for that:

http://people.apache.org/~rjung/patches/BaseDirContext_Alias_20100423a.patch

What do you think?

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message