About resourceBaseUr, serverName and serverPath

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

About resourceBaseUr, serverName and serverPath

Miguel Enrique Cobá Martínez
Hi all,

I have some questions about #resourceBaseUrl, #serverName and #serverPath.

In their default state they are ''. This is how I understand them:

#resourceBaseUrl
-----------------

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'

you write:

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?


# serverName
-------------
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:

http://localhost:8080/seaside/myApp?_s=asdfasdf&_k=adsfasfa

if you are accessing the app as:

http://localhost:8080/seaside/myApp

or

http://example.com/seaside/myApp?_s=asdfasdf&_k=adsfasfa

if you are accessing the app as

http://example.com/seaside/myApp

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:

http://error.com/seaside/myApp?_s=asdfasdf&_k=adsfasfa

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:

http://localhost:8080/seaside/myApp

the URLs generated will be:

http://example.com/seaside/myApp?_s=asdfasdf&_k=adsfasfa

and you will be interacting with your real application and not the
development one.

Is this correct?

# serverPort

This one behaves analogous to serverName.



So, can you please comment about this preferences and tell me if I am wrong?

Thank you,
Miguel Cobá



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: About resourceBaseUr, serverName and serverPath

Julian Fitzell-2
Sounds about right, I think, yup. The idea of serverName and
serverPort is that you might have apache (or whatever) sitting in
front of your site at example.com:80, while Squeak is actually
listening on port 8080 of some internal IP (or localhost).

Julian

On Thu, Feb 26, 2009 at 11:42 PM, Miguel Enrique Cobá Martínez
<[hidden email]> wrote:
> So, can you please comment about this preferences and tell me if I am wrong?
>
> Thank you,
> Miguel Cobá
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside