[Seaside] static image files

Brad Fuller brad at sonaural.com
Fri Feb 24 23:45:01 UTC 2006

I don't quite understand why one would have to restart the server to
serve a static image file in a directory.
Isn't there a default directory from which to place files that can be
served? And if so, what is it? I only see Resource Base Url as a setting
in config, but I don't know what that is.

I suppose it is better to create a dictionary of graphics if they are
small so that locating the image is not a problem every time.
How do others do it? What is the best way to serve graphics (be it small
or large!)



(BTW: I've spent several days creating a seaside website from scratch
and I'm almost ready to deploy a _BASIC_ version of it. Still got some
kinks. I'm having quite a bit of fun. Seaside is wonderful. I hope that
we can do more than we could with Flash. Certainly looks so.)

David Shaffer wrote:
> 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