[Seaside] static image files
Christian Mascher
christian.mascher at gmx.de
Tue Feb 7 21:39:53 CET 2006
Hello,
a question the tutorials didn't help me with: how can I make an
image-file show up? I tried this in Counter>>renderContentOn:
html image: 'filename.png'
but nothing happened. First I thought it was the directory-problem. If I
put the image in the same directory as the squeak .image and .exe is an
URI with just the filename correct in this case?
Then I found in another tutorial, I have to tell WAKom to serve static
files as well. So I did this (from the Schaffer-tutorial, with the
FileRoot renamed):
"Kill all existing Kom HTTP servers"
HttpService allInstancesDo: [:each | each stop. each unregister].
"Start a new server on port 9090 servering both static content and
seaside apps"
| ma seaside |
seaside := WAKomEncoded default.
ma := ModuleAssembly core.
ma serverRoot: (FileDirectory default directoryNamed: 'D:\squeak37')
fullName.
ma alias: '/seaside' to: [ma addPlug: [:request | seaside process:
request]].
ma documentRoot: (FileDirectory default directoryNamed: 'D:\squeak37')
fullName.
>>BTW: Can I specify other base directories in both cases, or just for
>>the documentRoot (static content)? Quite a bit confused here...
>>In other words: Why specify a server root, when it is the same with
>>FileDirectory default (place of the image)
ma directoryIndex: 'index.html index.htm'.
ma serveFiles.
(HttpService startOn: 9090 named: 'httpd') plug: ma rootModule
Now I could go to http://localhost:9090/ and the server would give me a
static index.html I put in the directory 'D:\squeak37'. But the image
referenced in this file could still not be loaded. So no wonder it
didn't work in the seaside-application. Still the image-file is there
and I can open it with FileList in squeak, so the format seems OK.
Whats going on?
Thanks
Christian
More information about the Seaside
mailing list