[Seaside] [ANN] Indep. SqueakBased web server app sample WAS: static content

Torsten Bergmann astares at gmx.de
Thu Jan 27 20:14:37 CET 2005


Hi,

Jason Rogers wrote:
>How does one serve static content using Seaside with Comanche without
>Apache? 

I will try to answer the question with a documented comanche/seaside
based sample web application. 

The attached files include anything you should need - based on a 
new updated Squeak3.8gamma6550.image. First upgrade MCInstaller 
to version 11 from SqueakMap. Then install in the given order:
	
    DynamicBindings 1.2.
    KomServices     1.1.1.
    KomHttpServer   7.0.2
    Seaside         2.5b7

via Squeak PackageLoader from SqueakMap. Now file in the fix 
for "NetworkHost-nameString.st.gz" otherwise you will get a walkback
if your machine returns just it's ip address as OrderedCollection. 
This fix should in generally go into the comanche package in a next 
version. Now place the seaside.png file into your image 
directory.

Install SeasideComancheSample-tbn.1.mcz from the file list and evaluate:

	MyWebApplication start

in a workspace. 
Now point your browser to: http://localhost:9092/seaside/myapplication
to show the sample application. (on Windows use "MyWebApplication 
browse"). If you want to start the webserver on a different port
use the #startOn: message.

If you point your browser to http://localhost:9092/ you will
see the contents of your image startup directory. This is defined in
MyWebServer(class)>>fileServerDirectory. The real magic for serving 
static content using Comanche happens in
MyWebServer(class)>>createKomHttpService. 

If you place an index.html or index.htm file in the file server directory
(in this case the image directory) it will be shown instead of the
directories contents.

Note that the package has only three well documented classes. If you save
this image the webserver will automatically start the next time because 
MyWebApplication registers itself in the Squeak startup list in it's class
side #initialize method.

That should help building a seaside starter application without any futher 
external dependency like Apache, ...
Anything you need is to copy the VM, the image and your web applications
resources.

Unfortunately the png image is not displayed correctly. Havent 
tracked this bug yet - just wanted to show the basic architecture 
for building an independent comanche based webapplication including 
static content serving. Maybe we can fix this bug and build a better 
sample application showing the use of internal/external CSS, seaside 
components, a nice look & feel, ... for newcomers - based on this first 
sample.

Have fun,
Torsten



-- 
10 GB Mailbox, 100 FreeSMS http://www.gmx.net/de/go/topmail
+++ GMX - die erste Adresse für Mail, Message, More +++
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SeasideComancheSample-tbn.1.mcz
Type: application/x-zip-compressed
Size: 4864 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20050127/40d6889e/SeasideComancheSample-tbn.1-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NetworkHost-nameString.st.gz
Type: application/x-gzip-compressed
Size: 253 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20050127/40d6889e/NetworkHost-nameString.st-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: seaside.png
Type: image/x-png
Size: 15624 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20050127/40d6889e/seaside-0001.bin


More information about the Seaside mailing list