#18 forward doesn't work between contexts

closed-works-for-me
WebKit (58)
5
2006-07-06
2002-03-15
Anonymous
No

I found a strange bug in webware (or is it a feature?)
platform: linux
webware: cvs (15.03.2002)
python: 2.2

Circumstances:
/usr/local/Intranet/Webserver contains my application
environment (via
MakeAppWorkDir). There are two contexts: "Test" and
"Repository".
Test contains one Main.py that forwards the request
(self.application().forward(trans,'../Repository/Repositor
y')) to Repository.

The problem now seems to be, that the old path is
still known to some vital
element. Anyway, I think, the place where things go
wrong are in
WebKit.ServletFactory.py, line 78: remainder =
path[len(contextPath)+1:]
This cuts away from
"/usr/local/Intranet/Webserver/Repository/Repository.p
y" the part
"/usr/local/Intranet/Webserver/Repos"
Incidently, this is just the len of
"/usr/local/Intranet/Webserver/Test/", the original
context

Now the feature part:
forward can only be used within one context

Traceback:

/usr/local/Intranet/Webserver/Repository/Repository.p
y
Traceback (most recent call last):
  File "/usr/local/Webware/WebKit/Application.py",
line 388, in
dispatchRequest
    self.handleGoodURL(transaction)
  File "/usr/local/Webware/WebKit/Application.py",
line 534, in handleGoodURL
    self.createServletInTransaction(transaction)
  File "/usr/local/Webware/WebKit/Application.py",
line 990, in
createServletInTransaction
    inst = self.getServlet(transaction,path,cache)
  File "/usr/local/Webware/WebKit/Application.py",
line 916, in getServlet
    inst = factory.servletForTransaction(transaction)
  File "./WebKit/ServletFactory.py", line 178, in
servletForTransaction
  File "./WebKit/ServletFactory.py", line 94, in
importAsPackage
  File "./WebKit/ServletFactory.py", line 130, in
_importModuleFromDirectory
IOError: [Errno 2] No such file or directory:
'/usr/local/Intranet/Webserver/Test/itory/__init__.py'

Discussion

  • Geoff Talvola
    Geoff Talvola
    2003-01-15

    Logged In: YES
    user_id=88162

    Assigning to Stuart because he's currently improving
    forward(), includeURL(), and callMethodOfServlet().

     
  • Geoff Talvola
    Geoff Talvola
    2003-01-15

    • assigned_to: nobody --> stuartd
     
  • Logged In: YES
    user_id=193957

    Forwarding from one context to another seems to work in
    Webware 0.9.1. Please reopen if you think there is still a
    problem.

     
    • status: open --> closed
     
    • status: closed --> closed-works-for-me
     
  • Logged In: YES
    user_id=193957

    Correction: I checked this only with a relative URL.
    Absolute URLs did not work. Fixed this in the SVN trunk
    together with bug #789693. This will go into Webware 0.9.2.