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.
Craig McClanahan
>
> ___________________________________________________________________________
> 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
___________________________________________________________________________
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