[Seaside] About resourceBaseUr, serverName and serverPath
Miguel Enrique Cobá Martínez
m.coba.m at gmail.com
Thu Feb 26 22:42:22 UTC 2009
I have some questions about #resourceBaseUrl, #serverName and #serverPath.
In their default state they are ''. This is how I understand them:
This is a handy way to *NOT* write your server hostname + resource path
every time you render a link or a image so, if
#resourceBaseUrl is 'http://www.example.com.mx/resources/"
then instead of writing:
html image url: 'http://www.example.com.mx/resources/images/image.jpg'
html image resourceUrl: 'images/image.jpg'
without polluting your code with the server name. This way, you can
change the server name to other domain or change the resource directory
to another path or even another server.
This is used for *you* the developer to generate URLs in anchors and images.
Is this correct?
This is used for *Seaside* to generate URLs in forms, links with
callbacks, link and meta tags.
If you don't specify it, they are are generated as:
if you are accessing the app as:
if you are accessing the app as
It appears to me that if they aren't specified, Seaside USE the
serverName and serverPort from the request.
If you specify them, those values ARE used, no matter the name you used
to access the app.
That is, if you specify this preference, say, as 'error.com', and your
app is in 'example.com', the url are generated as:
This will crash your app, because error.com doen't exists.
Or, another example, if you specify 'example.com' and are accessing the
app from your local machine, for instance, when developing, as:
the URLs generated will be:
and you will be interacting with your real application and not the
Is this correct?
This one behaves analogous to serverName.
So, can you please comment about this preferences and tell me if I am wrong?
More information about the seaside