WebKit.HTTPServlet | index /usr/local/share/webware/WebKit/HTTPServlet.py

`HTTP servlets`

Classes

``

WebKit.Servlet.Servlet(__builtin__.object)
  HTTPServlet

class HTTPServlet(WebKit.Servlet.Servlet)

``

`A HTTP servlet.
HTTPServlet implements the respond() method to invoke methods such as
respondToGet() and respondToPut() depending on the type of HTTP request.
Example HTTP request methods are GET, POST, HEAD, etc.
Subclasses implement HTTP method FOO in the Python method respondToFoo.
Unsupported methods return a "501 Not Implemented" status.
Note that HTTPServlet inherits awake() and respond() methods from
Servlet and that subclasses may make use of these.
See also: Servlet
FUTURE
* Document methods (take hints from Java HTTPServlet documentation)
`

Method resolution order:
  HTTPServlet
  WebKit.Servlet.Servlet
  __builtin__.object

Methods defined here:

__init__(self)

respond(self, trans)
  `Respond to a request.
  Invokes the appropriate respondToSomething() method depending on the
  type of request (e.g., GET, POST, PUT, ...).`

respondToHead(self, trans)
  `Respond to a HEAD request.
  A correct but inefficient implementation.`

Static methods defined here:

lastModified(trans)
  `Get time of last modification.
  Return this object's Last-Modified time (as a float),
  or None (meaning don't know or not applicable).`

notImplemented(trans)

Methods inherited from WebKit.Servlet.Servlet:

awake(self, trans)
  `Send the awake message.
  This message is sent to all objects that participate in the
  request-response cycle in a top-down fashion, prior to respond().
  Subclasses must invoke super.`

close(self)

log(self, message)
  `Log a message.
  This can be invoked to print messages concerning the servlet.
  This is often used by self to relay important information back
  to developers.`

name(self)
  `Return the name which is simple the name of the class.
  Subclasses should *not* override this method.
  It is used for logging and debugging.`

open(self)

runMethodForTransaction(self, trans, method, *args, **kw)

serverSidePath(self, path=None)
  `Return the filesystem path of the page on the server.`

setFactory(self, factory)

sleep(self, trans)
  `Send the sleep message.`

Static methods inherited from WebKit.Servlet.Servlet:

canBeReused()
  `Returns whether a single servlet instance can be reused.
  The default is True, but subclasses con override to return False.
  Keep in mind that performance may seriously be degraded if instances
  can't be reused. Also, there's no known good reasons not to reuse
  an instance. Remember the awake() and sleep() methods are invoked
  for every transaction. But just in case, your servlet can refuse
  to be reused.`

canBeThreaded()
  `Return whether the servlet can be multithreaded.
  This value should not change during the lifetime of the object.
  The default implementation returns False.
  Note: This is not currently used.`

runTransaction(trans)

Data descriptors inherited from WebKit.Servlet.Servlet:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Functions

``

gmtime(...)
  `gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,
  tm_sec, tm_wday, tm_yday, tm_isdst)
  Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.
  GMT). When 'seconds' is not passed in, convert the current time instead.`

strftime(...)
  `strftime(format[, tuple]) -> string
  Convert a time tuple to a string according to a format specification.
  See the library reference manual for formatting codes. When the time tuple
  is not present, current time as returned by localtime() is used.`