forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: LocationMapModule
Date Fri, 17 Oct 2003 16:06:03 GMT
Unico Hommes wrote:

> Nicola Ken Barozzi wrote:
> 
>>Unico Hommes wrote:
>>...
>>>OK, what about creating a special purpose matcher:
...
>>>And have an equivalent one for regular expression matching. 
>>
>>Actually, I think this is exactly what you meant isn't it?
>>
>>Hmmm, not sure... how would you use this differently from the current 
>>parameter matcher?
> 
> The LocationMap.HINT_PARAM parameter is not passed in from the
> locationmap.xml but is already passed in from the LocationMap. So
> actually it would be like so:
>
> <locationmap>
> 
>   <components>
>     <matchers default="lm">
>       <matcher name="lm" type="o.a.c.matching.LocationMapMatcher" />
>     </matchers>
>   </components>
> 
>   <locator>
>     <match pattern="**.html">
>       <match pattern"style/**.html">
>         <location src="somewhere/styles/{1}.xsl" />
>       </match>
>       <match pattern="source/**.html">
>         <location src="somewhereelse/content/{1}.xml" />
>       </match>
>     </match>
>   </locator>
> 
> </locationmap>

Got it.

I see that it's very nice this way, as the user has normally no evidence 
other than the initial clean declaration that he's using a particular 
matcher.

:-)

>> You see, what I want is not to have to extend the current matchers,
>> but to be able to use them as-is. Since the most important matchers
>> match to the request URI, it seemed natural to me to add this info
>> to these matchers.
> 
> I see three, two reqexp flavors and one wildcard one.
...
> Remember there are only three matchers that actually would have to be
> wrapped this way. If you extend these and add the four lines of code
> that would be needed to make them compatible with the locationmap, you'd
> also get rid of the extra configuration section you'd have in the case
> of a wrapper matcher.
...
> I doubt there will be so many matchers to wrap/compose in order to
> make it pay off to have that additional configuration requirement.

Ok, got it.

If someone wants to make his matcher available as a locator-matcher, he 
can simply extend it like you have shown.

That means *any* matcher, not only the one that gets the request URI, so 
in fact this solution is more general too.

I agree 100% -> +1

Oh, and thanks again for implementing this and taking your time to 
discuss with me about it, it has been very nice :-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



Mime
View raw message