1.1 --- a/WebStack/Adapters/JavaServlet.py Fri Oct 05 22:27:28 2007 +0000
1.2 +++ b/WebStack/Adapters/JavaServlet.py Fri Oct 05 22:28:38 2007 +0000
1.3 @@ -41,7 +41,7 @@
1.4 class _Deploy(HttpServlet):
1.5 def __init__(self):
1.6 HttpServlet.__init__(self)
1.7 - self.dispatcher = Dispatcher(self.resource, self.authenticator, self.handle_errors)
1.8 + self.dispatcher = Dispatcher(self, self.resource, self.authenticator, self.handle_errors)
1.9
1.10 def service(self, request, response):
1.11 self.dispatcher.service(request, response)
1.12 @@ -56,14 +56,16 @@
1.13
1.14 "A servlet helper class dispatching requests to WebStack resources."
1.15
1.16 - def __init__(self, resource, authenticator=None, handle_errors=1):
1.17 + def __init__(self, servlet, resource, authenticator=None, handle_errors=1):
1.18
1.19 """
1.20 - Initialise the root application-specific 'resource' and optional
1.21 - 'authenticator'. The optional 'handle_errors' parameter (if true)
1.22 - causes handlers to deal with uncaught exceptions cleanly.
1.23 + Initialise the dispatcher, providing the deployment 'servlet', the root
1.24 + application-specific 'resource', and an optional 'authenticator'. The
1.25 + optional 'handle_errors' parameter (if true) causes handlers to deal
1.26 + with uncaught exceptions cleanly.
1.27 """
1.28
1.29 + self.servlet = servlet
1.30 self.webstack_resource = resource
1.31 self.webstack_authenticator = authenticator
1.32 self.handle_errors = handle_errors
1.33 @@ -74,7 +76,7 @@
1.34 Handle the 'request' and 'response' presented by the servlet.
1.35 """
1.36
1.37 - trans = WebStack.JavaServlet.Transaction(request, response)
1.38 + trans = WebStack.JavaServlet.Transaction(request, response, self.servlet)
1.39 try:
1.40 if self.webstack_authenticator is None or self.webstack_authenticator.authenticate(trans):
1.41 try: