Smalltalk/X WebserverSmalltalk Dynamic Web Pages - Source of WebDemoApp1-test7: | |
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 (disabled)
| |
ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 14 Oct 2024 01:37:11 GMT |