On Wednesday, March 31, 1999 7:51 AM, Craig R. McClanahan
[SMTP:[EMAIL PROTECTED]] wrote:
> > > - map a servlet Z to "/file.html"
> > > - map a servlet A to "/catalog"
>
> 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.
Gabriel Wong wrote:
> suggest a variation of your suggestion:
> * "Longest prefix" match (except for "/"); else
> * Extension match which CAN include extra path info (the extra path info
> CANNOT include "."); else
> * "/" match (i.e. the default servlet) if nothing else matches
> without any special cases for exact pathname matching.
All of this scares me. I hope the powers-that-be are more on the ball
than this. The HTTP protocol (and therefore any Servlet protocols) does
_not_
know or care about "file extensions".
If I want to call a directory on my server "frank.html", or a file
"directory", I should
be able to, without any hidden penalties or assumptions from the server or
servlet
engine. All that is required is that the server knows how to assign the
correct
mime type to everything it serves.
If I want to run a server on a system which _doesn't_have_file_extensions_,
but
encodes file/mime type information separate from the file name, I should be
able
to, without any hidden penalties or assumptions from the server or servlet
engine.
(and I actually do do this at home. One of my servers runs Acorn RiscOs)
I understand that the current system of specifying mappings is (a)
underspecified
and (b) a protototype, the best that could be implemented at short notice.
From
what James Duncan Davidson has posted here, I also understand that work is
underway to design and specify a "better" system.
I suggest that we gather up all the kinds of mappings we can think of, and
ensure
that any proposed mapping system supports them all clearly and
unambiguously.
The following "requirements" seem to already have cropped up:
+ Map servlets to specific full URLs (eg. http://host/ugh/a/fred)
+ Map servlets to specific URL prefixes (eg. http://host//ugh/a/fred/...)
+ Map servlets to specific mime or file types
+ Map servlets to specific system directories
+ Map servlets to specific system files
+ Map servlet to the default case ( / )
+ Override mappings for a "servlet context" (aka Jserv "zones")
+ Override mappings for a system directory subtree
+ Override mappings for a URL prefix
+ Any valid HTTP character should be valid in directory, context, file and
servlet
names.
Extra "suggestions", so far include:
+ Proper regular expressions for mapping rules
+ The ability to correctly map "/~frank" style home directories
+ A way of setting the priority of different rules, to avoid conflicts
Please add any more that you can think of.
I hope this didn't read like a flame, it wasn't meant that way.
--
Frank Carver
[ Personal: [EMAIL PROTECTED] http://www.efsol.com/ ]
[ At Work: [EMAIL PROTECTED] tel +44 (0)1473 227371 ]
___________________________________________________________________________
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