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 *.foo.com ? I'd say .foo.com 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: .private.foo.com and .foo.com
- 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 ... :(

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to