tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <>
Subject Re: Code Submission - Wild Card Aliases
Date Wed, 04 May 2005 11:45:02 GMT
George Sexton wrote:
> Let me see what I can do.

So that I don't get a too bad reputation, here's an algorithm idea I 
thought about:
- first, why use * ? I'd say is better (the algo will 
use it)
- use a separate array for wildcard host names, where they are stored 
reversed (ex: moc.oof).
- after doing the regular lookup, do a lookup in the wildcard host array 
(same as wildcard servlet mapping), but using the reversed host 
(findIgnoreCaseReverse or something) where you start with the last char
- if the int returned corresponds to something which "starts with" 
(reversed) with your host, then it's the best match

This way:
- if there are no wildcard hosts, the cost is zero (the array will be empty)
- you get nesting for free (ex: and
- you don't need to add hosts to the main host array
- you get to code funny algorithms during work hours, which IMO beats 
doing Struts form beans (YMMV)

I still think the feature is borderline bloat, though ... :(


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message