[Seaside-dev] The Big Pentecost Server Refactoring

Philippe Marschall philippe.marschall at gmail.com
Sun May 11 15:14:26 UTC 2008


Hi

Besides running in a circle for ten miles I actually managed to get
something done this weekend. The basic idea is that we move much more
encoding stuff to the server. There are two reasons behind this. First
we don't have the neccessary information to do the right thing (tm) in
Seaside and even if we had it we could not do it in a portable way. A
positive side effect is that vendors can use their encoding primitives
because this is really a bottleneck.

We now have two different encodings
- the encoding of the page aka the body encoding
- the encoding of URLs

The body encoding is whatever the user specifies in his application
(formerly the session). Often this will be either utf-8 or iso-8859-1
but in general any intersection between what the dialect and the
browser supports should work.

The URL encoding should be UTF-8, this should work with most newer
browser but is likely to cause problems with IE 5.0 and friends.

There is infrasturcture in the form of WAServer and WACodec that you
can use to build your server adapter to you're free to do your own
thing.

On the Squeak side this is only implemented for Kom so far.
Additionally it has a bug where the encoding is always set to utf-8
after saving the image.

A server is stored in the request context and must support the
following methods:
#codec
#usesSmalltalkEncoding

codec returns something that understands #encodeUrl:

#usesSmalltalkEncoding
Is used only used by tests and answers whether multiple bytes are
mapped to one Character.

There are quite some tests for many combinations GET, POST, multipart,
urlencoded, ...

Additionally:
- WARequest fields now contains both GET and POST fields.
- SeasidePlatformSupport must have a method #utf8Codec that returns a
platform specific utf-8 coded (needed for unit tests only)

While we're introducing these changes I think it makes sense if server
will have to set #remoteAddress to a WARequest. So that
WASessionProtector will no longer have to send #nativeRequest.

Cheers
Philippe


More information about the seaside-dev mailing list