On Wed, 2002-03-20 at 11:20, Love, Jay wrote:
> As I sat down to write a response to this proposal of per servlet
> extraURLPath, saying this will be really hard to do, I decided to think
> before I responded (a rare thing).  And actually, this might not be too
> terribly difficult.
> 
> The way extraURLPathInfo works is that when we get the request, we have to
> find the servlet that matches it.  So we start with the whole request URL,
> and see if it matches an actual file on the system.  If it doesn't, and
> extraURLPathInfo is turned off, then we return a 404.  If extraURLPathInfo
> is turned on, then we pull off the last directory in the URL and see if the
> remaining portion matches a path on the system, and so on until we either
> find a servlet or reach the root of the context.  If we find a servlet that
> matches a portion of the URL, then we use that servlet and pull off the rest
> of the URL and call it extraPathInfo.
> 
> The reason this is not alaways turned on is that at some point, you will
> find a servlet, almost always.  If you have a servlet named index or Main in
> the root of your context, that servlet is going to be found and it will get
> called with the extraURLInfo.  So no 404's, etc.

I think index/Main servlets shouldn't take extraURLPathInfo (unless
"index" or "Main" is actually in the path).  It just doesn't make sense
in 99% of the cases, and the other 1% can be handled by mod_rewrite.

It's not, IMHO, a big deal if 404s are slow -- it's erroneous behavior,
and hopefully accounts for a small portion of total traffic.  Non-404s
are only slow to the degree that you use extraURLPathInfo -- if you
don't use them at all, then there's no speed effect.  If you do use
them, then you get what you asked for.  Anyway, my intuition is that
searching the filesystem for files isn't that slow, relative to the
speed of servlets themselves.  A 404 will probably still be considerably
faster than an actual page served.

So you can turn extraURLPathInfo on for every request.  If you still
want it to be configurable, all that logic can be in
Servlet/HTTPServlet: in .awake() or something, the servlet can check if
extraURLPathInfo is empty, and if not, if the servlet is supposed to
accept extraURLPathInfo, and if not it can send a 404.  The URL mapping
code doesn't need to deal with it at all -- it doesn't have to be the
sole source of 404s.

  Ian



_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to