View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

How to setup a Smalltalk website - Derek Tatum

 What are you trying to do?

-If you want to make a "Smalltalk website," you have to use a server that supports Smalltalk code. This tutorial is based on VisualWorks' own Smalltalk server called "VisualWave." (NOTE: a great tutorial to look at in addition to his one is Cincom's own web tutorial for Web Toolkit:

1. To acquire VisualWave, you need to go to the Parcel Manager and make sure you have installed VisualWave. While you are at it, go ahead and install WebToolKit. You will want to have that for sure as well.

2. You should have now seen a new icon appear on the main window of VisualWorks. It will be on the right end, and it will look like a computer on top of a picture of the earth. Click on it.

3. You just opened up a VisualWave window. Now what you want to do is create a server. Set it to a TinyHttp (this is good for running local servers), pick any port number (that is available on your computer. I use 8008), and go ahead and start it. If you have problems, just pick a different port number. Or you may just need to restart your browser.

4. Now open up a web browser and type "http://localhost:8008/" (be sure to change 8008 to whatever your port number is). You should see the WebToolKit homepage. This is why I had you load it in earlier. Now you can easily create a local website for your VisualWave Smalltalk Server.

5. Once you get to the WebToolKit homepage, click on the Manage Sites link (http://localhost:8008/configure/manageSites). Then insert a name for a new website, and click the Create New Site link.

6. You should now see a page with a form. The most important item  is the Home Directory field. Be sure to fill that with an address to a folder on your computer which you want to use as a base directory for all your web files. You can use any folder that you want.

7. Also be sure to fill in the Home Page field with whatever .htm, .html, .ssp, etc. file that you want to use as a Home Page. Remember that you can just use a relative address for this field entry. Make sure the name that you type is the name of a file that exists in your Home Directory.

8. Okay, now it's time to create a few webpages. But first, you will probably want to download a free text editor such as "Notepad++". Anyway, one of the most important things to realize is that .htm or .html pages CANNOT recognize Smalltalk Code. In order to run Smalltalk code on a webpage, you will want to rename your file to a file with an extension of ".ssp". You can run Smalltalk code in this kind of file.

9. In order to run Smalltalk code in a .ssp file, you will want to insert it between <% and %> tags. This will tell the server that you are now going to be running Smalltalk code. Any objects defined in your VisualWorks Smalltalk image are now available for your usage (with proper initialization, of course).

10. Make a file with extension ".ssp" and open it in Notepad++ or some other editor. Make it look like the top portion of this picture. Then, when you open it up in your Web Toolkit site, you should see the actual current date! Neat huh? The Server is interacting with Smalltalk's Date class in order to do this.

11. Have fun tinkering around with constructing a site that executes Smalltalk code. One important note, however, is that you remember to include your namespace when instantiating a custom namespace's object e.g. Say "wagon:= OregonTrail.GameManager new." instead of just "wagon:= GameManager new." That will save you a few headaches.

12. Once again, be sure to refer to Cincom's Web Toolkit Tutorial if you get stuck (

Links to this Page