eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HTTPPluggableActionService':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: HTTPPluggableActionService


Inheritance:

   Object
   |
   +--HTTPService
      |
      +--HTTPPluggableActionService

Package:
stx:goodies/webServer
Category:
Net-Communication-HTTP-Services
Version:
rev: 1.10 date: 2016/08/22 09:27:37
user: mawalch
file: HTTPPluggableActionService.st directory: goodies/webServer
module: stx stc-classLibrary: webServer
Author:
Claus Gittinger

Description:


A service which associates page-URLS with a block's evaluation.
Can be used for quick ad-hoc and Expecco-driven webservices.
The registered block (-> register:as:) is evaluated with the httpRequest object
as argument.

Blocks are registered to react on absolute URL-paths,
and all request-URLs below a particular action link are handled by this block.

For example, if a block is registered as '/foo/bar',
then also '/foo/bar/baz', '/foo/bar/bla' and '/foo/bar/baz/bla/bla' are handled by
that block.


Instance protocol:

registration
o  linkNames

o  register: aBlock as: aPageNameString
register a page with given (full) link name

request handling
o  process: aRequest
not reached


Examples:


|server service| server := HTTPServer serverOnPort:9091. service := HTTPPluggableActionService new. service register:[ :req | req reply:'Hello World' ] as:'hello'. service register:[ :req | req reply:'Bla' ] as:'hello/bla'. service registerServiceOn:server

ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 16 Apr 2021 10:24:50 GMT