eXept Software AG Logo

Smalltalk/X Webserver

Smalltalk Dynamic Web Pages - Source of WebDemoApp1-test7:

Home

Documentation
www.exept.de
Everywhere
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.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 23 Apr 2024 16:59:53 GMT