eXept Software AG Logo

Smalltalk/X Webserver

Smalltalk Dynamic Web Pages - Source of WebDemoApp1-test7:

Home

everywhere
www.exept.de
for:
test7:aRequest
    "a dynamic html page, showing a factorial table.
     Invoke via browser as URL:
        host:port/<N>,test7:
     where <N> is the registered name of this service.
    "

    |replyPresenter|

    replyPresenter := aRequest replyPresenter.
    replyPresenter title:'Generated Factorial table'.
    replyPresenter parametersAt:#secondHeadLine put:'Test7: Generated Factorial table'.
    aRequest
        nextPutLine:'<h1>Factorial table</h1>';
        nextPutLine:'<table border>';
        nextPutLine:'<th WIDTH=50>x</th>';
        nextPutLine:'<th>fac(x)</th>'.
    1 to:40 do:[:i |
        aRequest nextPutLine:'<tr>'.
        aRequest nextPutLine:'<td ALIGN="center">' , i printString , '</td>'.
        aRequest nextPutLine:'<td ALIGN="right">'  , i factorial printString , '</td>'.
        aRequest nextPutLine:'</tr>'.
    ].

    aRequest nextPutLine:'</table>'.
    self addLinksForSource:#'test7:' previous:#'test6:' next:#'test8:' to:aRequest.

Edit
Index


ST/X 7.1.0.0; WebServer 1.653 at exept.de:8081; Mon, 23 Oct 2017 00:45:39 GMT