"Craig R. McClanahan" wrote:
>
> James Duncan Davidson wrote:
>
> > >  - map a servlet X to "/"
> > >  - map a servlet Y to ".html"
> > >  - map a servlet Z to "/file.html"
> > >  - map a servlet A to "/catalog"
> > >  - map a servlet B to "/catalog/foo"
> > >
> > >  - request "/file.html" should be served by Z
> > >  - request "/foo.html" should be served by X
> > >  - request "/catalog/foo/bar" should be served by B
> > >
> > > It would be nice if James Davidson can confirm this.
> >
> > As requested -- this is the way that the spec is intended to work.
> >
>
> OK, now I have a question ... how does a servlet engine know the difference
> between the mapping for servlet Z and servlet A?  In other words, is the
> difference between a file mapping and a directory mapping because of the
> existence of the period in the Z mapping, or what?
>
> I'm mostly concerned about how you tell the difference between an "individual
> URL" match (which might be followed by some extra path information!) and a
> "directory path" match.  For example, what would you do with
> "/file.html/extra/path/info"?
>
> The rules that make the most sense to me are:
> * "Longest prefix" match (except for "/"); else
> * Extension match (which cannot include extra path info); else
> * "/" match (i.e. the default servlet) if nothing else matches
> without any special cases for exact pathname matching.

You're right, I must have been tired last night ;-) Making a difference
between "directory" and "exact URL" mappings doesn't make sense; it's all
just URL paths and with the simple rules used today "longest prefix"
matching is the best we can do.

File name extension mapping can be considered a very simple minded
regular expression mapping for URL paths ending with an exact string.
I agree that file extension mappings can not support extra path
information, since it leads to problems with paths including dots as
reported by Frank Carver.

James, can we agree on Craig's simple rules for 2.1.x and work on
something better, with Frank's list (and possibly Cezar's ideas) as a
starting point, for a future release?

--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

___________________________________________________________________________
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