[Seaside] static image files

David Shaffer cdshaffer at acm.org
Wed Feb 8 16:11:45 CET 2006

Christian Mascher wrote:

> 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'

You'll need to give more of the url since your browser will interpret
this to be relative to the seaside application's path.  What you want is
something like:

html image: '/filename.png'.

> [snip]

> 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)

I don't think there are any Kom modules that actually use the serverRoot
assignment.  It could probably ???? be removed without any problems.

As for documentRoot:, if you don't do that then ModuleAssembly will not
add a "ModDoc" to your module stack...in which case files will not be
served by Kom.  The Kom architecture is pretty straightforward so feel
free to have a look.  The most instructive thing to do is to build a
module stack yourself, without using ModuleAssembly.  BTW, despite its
name ModuleAssembly is not an assembly of modules, it is more of a verb
"module assembler".  You simple use MA to build your module stack and
then you discard it.  If you explore "Services serviceNamed: 'http'" you
can see what the module stack looks like.

> 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.

There was an incompatibility between older Kom and Squeak 3.8.  It
effected serving images among other things.  Try updating Kom from
SqueakMap and see if that helps.  If not please feel free to drop me a
line off-list.


More information about the Seaside mailing list