Title: cs2340: Web Design with Smalltalk
1cs2340 Web Design with Smalltalk
2Web Pages
3Static Details
4Dynamic Pages
5Basic Operation
- Client (browser) requests a page
- Application Server loads page
- Embedded scripts evaluated by server
- Results of the script are merged back into stream
to the client - Smalltalk code enclosed in
6Web Design
- Server is stateless
- Get / Post from client
- OK / Not Found from server
- For required state, use Cookies or Session
Variables - Pages static vs. dynamic
7Designer Tasks
8General Design (The Page Styles)
9General Design (Site Navigation)
10Design Backend Data
11VisualWorks Server
- System Parcel Manager load VisualWave and
WebToolkit - Test server by http//localhost8008/echo
- Test toolkit by http//localhost8008
- Create a directory in web for your code.
- Configure toolkit for directory
12Then we write some code
Hey, you got HTML in my Smalltalk. Well you got
Smalltalk in my HTML.
13Lets make a simple page (SSP)
Bobs Test
PagerWelcome to CS2340The date
today is l
14A more complex page
15The Html
16Workspace Code
empfile stream separator number firstName
lastName level empfile 'c\Program
Files\Cincom\vw7.4.1nc\web\bobstest\db\employees.t
xt' asFilename. separator ,. stream
empfile readStream lineEndCRLF. stream atEnd
whileFalse number (stream upTo
separator). level (stream upTo
separator). lastName (stream upTo
separator). firstName (stream upTo
separator). stream upTo (Character cr).
Transcript show number, level, firstName, '
', lastName cr. . stream close.
17Convert to SSP
18But
- Just using server pages is not reusable or object
oriented. - What if I need real classes and data?
19Workspace code a lot less
employees employees (Toyz new)
getEmployees. employees inspect.
20And so is our SSP
21Interaction
response redirectTo URL