> OK ... the prefix match mapping now makes sense to me (and runs faster than my
> "longest prefix match" approach, which requires a scan of all registrations).

Right -- one of the requirements for this is that we have a match system
that is fast. This one's speed is faster for shorter paths, slower for
longer paths, and much faster than doing a full regex check.

> In your pseudocode for parsing out the extension, you propose:
>
>     String ext = path.substring(path.indexOf('.'), path.length())
>
> which grabs everything from the *first* period on, and calls it the extension.
> This still works for a request URI like:
>
>     /dir1/dir2/file.html
>
> but it will not work intuitively on a path like
>
>     /dir.1/dir.2/file.html

Yes -- the simple code was a bit too simplistic. (I *had* just woke up..
:)

> Would it make sense to specify that extension mapping starts at the *last* period,
> instead of the first?  In other words, the parse line would say:
>
>     String ext = path.substring(path.lastIndexOf('.'), path.length())

Yes -- definitely... And the remaining ext should not contain a '/'
character because that is a significant separator. You get quibble bonus
points.. :)

> I can see both sides of the argument about supporting extra path information when
> doing extension matching (it might be nice to pass extra path information to a JSP
> page, for exampe), but I can live without it (perhaps pass the extra stuff as a
> query parameter instead).

the latter is how I'd see it best happen. JSP's primary interactive
mechanism will be parameters. If you need to do things based on path
info, then you really should be writing a full servlet and not a JSP.

.duncan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to