[Seaside] Naming URLs

Avi Bryant avi at beta4.com
Thu Apr 15 20:16:17 CEST 2004


On Apr 15, 2004, at 6:00 AM, radoslav hodnicak wrote:

> In seaside 2.3, override #createRootFromRequest: in your session class 
> to
> process URL and initialize your app according to what you got from URL.
> Use #addToPath: to put additional path into URL (it's ignored by 
> seaside).
>
> I assume a lot had changed in this area in seaside 2.5.

Yes.

To set the path, implement #updateUrl: in your components.  This will 
get passed a WAUrl instance, which responds to #addToPath: and 
#addParameter:value: (and will soon respond to #anchorName:).  Each 
active component gets a chance to modify it before every redirect and 
response.

To initialize your app, subclass WAMain and implement #start:.  This 
will be sent at the beginning of the session, and gets passed a 
WARequest instance.  Typically you will want to use the information in 
the request to construct a root component, and then start a render loop 
with that root:

	(WARenderLoop new root: aComponent) start: aRequest

However, you don't have to enter the render loop immediately, or at all 
- SmallBlog, for example, will simply return a static RSS response for 
certain URLs.

When configuring your application, make sure to choose your new 
subclass as the Main Class.

Avi



More information about the Seaside mailing list