Ok, I have investigated a little. In the Java Servlet
Specification page 29, a request is made up of:
requestURI = contextPath+servletPath+pathInfo
Where pathInfo is the extra path after the servlet
name. There is some examples in the specs. I don't
know but I suspect that java servlets all must
reside in one directory. That would of course
simplify the parsing.
If played around a little along Jay's advices, this
is a works-for-me solution. But nothing that should
be used in a final version. I didn´t put that much
effort in it since I don't know all details on what
the function is supposed to do.
def serverSidePathForRequest(self, request, urlPath):
''' Returns what it says. This is a 'private' service method for use by HTTPRequest. '''
+ # Create context path
+ tail = urlPath
+ pathInfo = ""
+ prepath = self._Contexts['contextName']
+ except KeyError:
+ prepath = self._Contexts['default']
+ if not os.path.isabs(prepath):
+ prepath = os.path.join(self.serverDir(), prepath)
+ # Look for servlets from right to left
+ while tail != '':
+ ssPath = os.path.join(prepath, tail + ".py")
+ if os.path.exists(ssPath):
+ request._fields['pathInfo'] = pathInfo
+ return ssPath
+ tail,head = os.path.split(tail)
+ pathInfo = os.path.join(head,pathInfo)
ssPath = self._serverSidePathCacheByPath.get(urlPath, None)
if ssPath is None: