|
Class: WebDemoApp1 (in Demos)
Object
|
+--HTTPService
|
+--HTTPSelectorService
|
+--Demos::WebDemoApp1
- Package:
- stx:goodies/webServer
- Category:
- Net-Communication-HTTP-Services-Demo-WebApplications
- Version:
- rev:
1.65
date: 2019/07/13 12:19:17
- user: cg
- file: WebDemoApp1.st directory: goodies/webServer
- module: stx stc-classLibrary: webServer
- Author:
- Claus Gittinger (cg@exept)
Demonstrates some webApplication features.
To start:
start the HTTPServer at some port
aServer := HTTPServer startServerOnPort:8080
register the class (towards the HTTPServer) with:
Demos::WebDemoApp1 registerServiceIn:(HTTPServer runningServers first)
Open a netscape or internet explorer (somewhere);
enter the URL:
httP://host:port/WebDemoApp1/test1
or (test2, test3, ...)
For each request, a corresponding method in this class is
invoked, which returns an html document.
HTTPServer
class access
-
defaultReplyPresenterClass
-
defaults
-
linkName
-
return the default linkName path (with slash)
queries-service
-
isThreadSafe
-
-
settingsApplicationClass
-
a SettingsApplication class - or nil (used in the settings dialog if non-nil)
queries-service
-
addRequiredForeignServicesTo: anHTTPServer
-
I need a file service for the bitmaps and icons
-
allowedMessages
-
-
defaultMessage
-
-
offeredItems
-
serving
-
acceptSource: aRequest
-
-
editSource: aRequest
-
-
openAsWebPage: aRequest
-
-
showSource: aRequest
-
-
sourceForSelector: anArgument
-
-
test1: aRequest
-
a simple reply, with an URL refering to another method inside myself.
Invoke via the browser as URL:
host:port/<N>,test1:
where <N> is the registered name of this service.
-
test2: aRequest
-
another simple reply, with an URL refering to another method inside myself
Invoke via the browser as URL:
host:port/<N>,test2:
where <N> is the registered name of this service.
-
test3: aRequest
-
a dialogForm; when submitted, test3Action is invoked.
Invoke via the browser as URL:
host:port/<N>,test3:
where <N> is the registered name of this service.
-
test3Action: aRequest
-
a dialog's action; invoked when the dialog from test3 is submitted.
This one simply shows the entered values
-
test4: aRequest
-
another dialog form
Invoke via the browser as URL:
host:port/<N>,test4:
where <N> is the registered name of this service.
-
test4Action: aRequest
-
a dialog4's action; invoked when the dialog from test4 is submitted.
This one executes a unix command based on the input, and
shows the output in a textArea
-
test5: aRequest
-
send a file
- requires a test4.html file
to be found under the htmldialogs directory.
-
test6: aRequest
-
send a file
- requires a test6.html file
to be found under the htmldialogs directory.
-
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.
-
test8: aRequest
-
a dynamic html page, upload a file.
Invoke via browser as URL:
host:port/<N>,test8:
where <N> is the registered name of this service.
-
testGoogle: aRequest
-
a dynamic html page, showing a factorial table.
Invoke via browser as URL:
host:port/<N>,testGoogle:
where <N> is the registered name of this service.
-
testStauSuche: aRequest
-
-
test_svg1: aRequest
-
a reply, generating html using an HTMLBuilder
Invoke via the browser as URL:
host:port/<N>,svg1:
where <N> is the registered name of this service.
-
test_svg2: aRequest
-
a reply, generating html using an HTMLBuilder
Invoke via the browser as URL:
host:port/<N>,svg1:
where <N> is the registered name of this service.
-
theSVG1: aRequest
-
a reply, generating svg which is embedded by test_svg1:
-
theSVG2: aRequest
-
a reply, generating svg which is embedded by test_svg2:
-
timeNow: aRequest
-
a very simple reply: shows the current time.
Invoke via the browser as URL:
host:port/<N>,timeNow:
where <N> is the registered name of this service.
serving-helpers
-
addLinksForSource: selector previous: previousOrNil next: nextOrNil to: aRequest
-
start the HTTPServer at some port and register
the class (towards the HTTPServer)
Open a netscape or internet explorer (somewhere);
enter the URL:
httP://host:port/WebDemoApp1:test1
or (test2, test3, ...)
|aServer|
aServer := HTTPServer serverOnPort:8081.
self registerServiceIn:aServer.
|
|