Colin Low wrote:

> I tried the following in a JServ 1.b5 servlet running under Apache 1.3.6
>
> HttpRequest req.getRealPath(req.getRequestURI())
>
> returns the request URI appended to the document root, and no alias
> translation takes place, so the resulting path is useless.
>
> getServletConfig().getServletContext().getRealPath(req.getRequestURI())
>
> returns null, which isn't a lot of use either.
>
> Would anyone like to provide a rationale? I've read the Sun Servlet spec,
> and can't say that either result fits my expectation.
>
> Colin Low
>
> PS. Running on Windows
>

The technical reason for this is that the protocol currently used to connect
Apache and Apache JServ has no mechanism to ask Apache what the aliased path
should be.  The best we can do is take the Apache DOCUMENT_ROOT (which is
sent to JServ as part of the request) and tack on the path you specified.

Aliasing is applied in the restricted case where you call
request.getPathTranslated(), because Apache includes that translation when
it passes on the request -- but it fails in the general getRealPath() case.

IMHO:  This issue is not likely to be dealt with in 1.0, because of the
substantial amount of work involved.in rewriting the protocol.  Work is in
progress on a future version of the protocol, which should deal with it.

Craig McClanahan




-- --------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to