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

Willem van den Ende seaside at willemvandenende.com
Fri Jan 28 11:12:47 CET 2005


Hi!

On Friday 28 January 2005 07:15, goran.krampe at bluefish.se wrote:
> Hi guys!
>
> First, Torsten - I have included the fix in my KomHttpServer dev image
> and it will be in the next release of KomHttpServer.
>
> Second - I may have misunderstood the question and the answer :) but
> KomHttpServer has an example of serving static content, even in the
> description at SM:
>
> 	http://map1.squeakfoundation.org/sm/packagebyname/komhttpserver
>
> I assume the question perhaps had to do with how to do this in
> combination with *Seaside* somehow - but anyway.=20

I had the same problem last week, combining static content from komanche wi=
th=20
seaside. For some reason the example from komanche SqeuakMap did not work f=
or=20
me (I'm not sure if the example code changed recently, I'll assume it=20
didn't).

Making it work forced me to learn more about how komanche and seaside work,=
 so=20
I guess this is a good thing - I feel more confident now changing things,=20
both komanche and seaside are powerful and flexible (the seaside config may=
be=20
being on the overly flexible side for what I do with it).

Looking back at what is is in squeakMap now, I can see why it didn't work. =
My=20
code for starting seaside and komanche is very similar. What I did was try=
=20
the example in SeaSide first:=20

WAKom startOn: 9090.=20

Later on, I tried the example from komanche (HttpService startOn: 8080 name=
d:=20
'httpd') plug: ma rootModule

That doesn't fully work, since the port number is duplicated in SeaSide and=
=20
Komnanche. If you want to change the port, you'll also have to change the=20
port numer in SeaSide - otherwise URLS are not correctly generated by seasi=
de=20
=2D they still contain the previous port number. I did it like this (not su=
re=20
if this is the simplest way - it looks kind of messy):

WAGlobalConfiguration instance localConfiguration valueAt: #serverPort put:=
=20
8080.=20

One thing I found handy to do before starting the HttpService on a new port=
,=20
was make sure there are no more HttpServices running:

HttpService allInstancesHttpService allInstances
		do: [:httpservice | httpservice unregister].
		do: [:httpservice | httpservice unregister].

It works smoothly now, and I must say developing with SeaSide and Komanche =
is=20
really a pleasure :-). So thank you Goran, Avi and others for making this=20
possible :-)=20

cheers,

Willem.


> Also, for an approach=20
> of web apps that does NOT use Seaside magic - HttpView is kinda nice
> IMHO:
>
> 	http://map1.squeakfoundation.org/sm/packagebyname/httpview
>
> HttpView uses the same underlying HTML builder as Seaside does (well,
> they may have diverged now, but I did make an adaptation of HttpView to
> use it a while back) but with extras bolted on.
>
> regards, G=F6ran
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside



More information about the Seaside mailing list