[Yanel-development] Root realm at bottom of file

Josias Thoeny josias.thoeny at wyona.com
Thu Dec 7 22:21:17 CET 2006


Hi Michi,

> Hi
>
> I noticed that the root realm within conf/realms.xml has been moved to
> the bottom of the "file".
>
> Is that a requirement?

First of all, thanks for applying the patch.
The root realm has been moved to the bottom of the file because MapImpl
now finds the realm for a given url as follows:
It scans the list of all realms in the config file from top to bottom and
takes the first one whose mount-point matches the url. This means that
arbitrary mount-points should now be possible. But it also means that the
order is important if more than one mount-point matches a url.

For example:
realmA: mount-point=/foo/bar/
realmB: mount-point=/somethingelse
realmC: mount-point=/foo
realmD: mount-point=/   (root realm)

A request for the url "/foo/bar/index.html" matches realmA, realmC, and
realmD. Because of the given order, realmA will be used.
The root realm will match any url and therefore has to be last one in the
list.

I tried to explain this with a comment in the realms config file.
If people think it's confusing, we could change the algorithm to always
use the realm with the longest mount-point (the "most specific one") among
all realms with a matching mount-point.

WDYT?

Josias


>
> Cheers
>
> Michi
>
> --
> Michael Wechner
> Wyona      -   Open Source Content Management   -    Apache Lenya
> http://www.wyona.com                      http://lenya.apache.org
> michael.wechner at wyona.com                        michi at apache.org
> +41 44 272 91 61
>
>
> _______________________________________________
> Yanel-development mailing list
> Yanel-development at wyona.com
> http://wyona.com/cgi-bin/mailman/listinfo/yanel-development
>
>




More information about the Yanel-development mailing list