-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------
Reich, Stefan wrote:
> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
>
> Hi everybody,
>
> I'm currently trying to upgrade from JServ 0.9 to JServ 1.0 (Solaris 5.6, JDK 1.2
>FYI, but this shouldn't matter).
>
> We call our servlets this way: http://host/servlet/package1/package2/ServletName
>
> This doesn't work in 1.0 anymore. It always says "File not found on this server".
>Eventually, I discovered I have to write
>http://host/servlet/package1.package2.ServletName now - dots instead of slashes.
>
> In 0.9 both versions were accepted.
>
At least one important issue is that a pathname with all slashes is ambiguous,
according to the Servlet API 2.0 specification. The part of the request URI that
appears *after* the part used to map to the
servlet is supposed to show up as the result of the getPathInfo() call, and there
isn't any good way to tell apart the slashes that separate the components of a Java
package name from the slashes that are
separators in the path information string.
IMHO, a better strategy is to use the feature of Apache JServ (in both 0.9 and 1.0) to
map a URI path directly to a particular servlet, in the zone properties file. For
example, you can define a line like
this:
servlet.foo.code=package1.package2.ServletName
and a request for "/servlet/foo" will resolve the actual Java path correctly. This
also lets you issue a request like this:
http://host/servlet/foo/extra/info
and your servlet will still get executed, with "/extra/info" passed to the
request.getPathInfo() call.
>
> Strangely, this change doesn't appear in the change history! And FAQ-O-Matic doesn't
>know anything about it either.
>
> Since all our pages link to servlets using the slash-syntax, we'd have a REAL
>problem if we had to change them all.
>
If you don't want to change them, well ..., you've got access to the source and can
change Apache JServ to behave the way you want. But don't count on being able to port
to any other server, because this
usage does not conform to the servlet API.
>
> Help appreciated,
> Stefan
>
Craig McClanahan
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]