#62 Bug in HTTPResponse code

WebKit (58)

In the HTTPResponse module (see
you will find the following method for flushing the
response cache

def flush(self, autoFlush=1):
if not self._committed:

The last line should be very obviously changed to


Or do I miss something?

I also noticed a problem when I do a flush and a
forward afterwards. Webware makes the forwarding, but
somehow the forwarding servlet seems to overwrites
the servlet to which it forwards in the servlet cache.
Webware should prohibit forwarding when the response
is already committed.


    • assigned_to: nobody --> jdhildeb
  • Logged In: YES

    Ok, I've applied the first bugfix to CVS -- thanks.

    With respect to the second problem, could you whip up a
    small test case which demonstrates the problem?

  • Logged In: YES

    Find attached a small test case demonstrating the problem.

    You can jump between page a and page b via ordinary links,
    and you can make a forward from page a to page b. Withthe
    flush() command commented out in servlet a, everything
    works fine. The response from page a is discarded and you
    see the response from page b. However, with the flush()
    command, you will get an error
    like "InvalidCommandSequence". It is understandable that
    an error is raised, since the response has already been sent
    to the web server and cannot be taken back, but the problem
    is that from now on, servlet b has been taken over by servlet
    a in the servlet cache. Even if you enter the address of
    servlet b or jump to servlet b, you will always get the output
    of servlet a. Things will only become normal again if you
    restart Webware or empty the servlet cache.

  • Test case for servlet take-over after forward

    • status: open --> closed-fixed
  • Logged In: YES

    Thanks for the test case. It looks like this code has
    changed since Webware 0.8.x, and instead of the
    InvalidCommandSequence exception you get an assertion error
    earlier in the call sequence.
    I was able to confirm that using webware from cvs, servlet a
    doesn't "take over" servlet b.

    I added some text to make the assertion failure more clear
    "Cannot reset response; it has already been sent.", which
    will hopefully help the developer in this situation.