tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Pita" <car...@aper.net>
Subject RE: ApJServMount status
Date Mon, 05 Jun 2000 20:15:34 GMT
Hi again!

    I was looking the CVS tree and I've some kind of beta answer to myself.
I'd like to commit the changes exposed here into (at least) my tomcat
sources but I think it would be better to get somebody else's points on this
first.

    "What's you solution?" i hear you asked. Here it's:

    (If some(posibly every)thing here is wrong please consider that I met
the CVS tree for the first time 2 hours before writing this)

The situation:
    First, the AJP12ConnectionHandler makes a nice AJP12RequestAdapter
(which is a specific case of RequestImpl). The request has useful fields
like context, serverName and requestURI, between others, which the rest of
the world sees from the HTTPServletRequest class interface. These fields are
filled by AJP12ConnectionHandler when processConnection'ing by the
invokation of readNextRequest method of the request adapter. Then the
connection handler wants to call the service method on the right servlet so,
not knowing how to do this by himself, it asks for help to the context
manager's service method, passing it the request as an argument. The context
manager then needs a servlet wrapper in order to invoke the method
handleRequest that will eventually call the appropiate service method. So it
gets on the task of finding that wrapper calling contextMap on each of the
configurated RequestInterceptors. One of these interceptors will be
SimpleMapper1 which would get the serverName and the requestURI from the
request and put them into the variables host and path.  Then it will call
getLongestPrefixMatch (which is a method of an asociated PrefixMapper)
passing the args host and path and this polite method will return a
container that will (finally!) bring the wrapper into life.

The problem:
    So the problem is: the context info is neither in the requestURI nor
(obviously) in the serverName. If the requestURI is prefixed with the right
context, everything is fine. But when the context is not prefixing the
requestURI, the wrapper obtained will belong to a wrong context (perhaps an
inexistent one).

The solution:
    To pass to getLongestPrefixMatch a string fixed by substituting the
mapped URI path with the right context to which it's mapped (this is
unnecesary when they're the same). This doesn't imply to change the
requestURI, only to temporarily generate and pass the suggested parameter to
getLongestPrefixMatch.

----- Original Message -----
From: Carlos Pita <carlos@aper.net>
To: <tomcat-dev@jakarta.apache.org>
Sent: Monday, June 05, 2000 1:06 PM
Subject: ApJServMount status


Hi!

    I'm very confused using the ApJServMount directive. I can't get URLs
paths (in the first argument to ApJServMount) correctly mapped to the
indicated context (in the second argument to ApJServMount).
    I'm asking here in the dev list because I need to know how well is the
directive implemented, how could I help if there's some work pending and if
I should use JServ for my web applications meanwhile.
    I have seen a number of questions without answer on this. I hope someone
could give me a hint.

    Thank you in advance, Carlos.



Mime
View raw message