[Seaside] REST-ful urls
John Thornborrow
john at pinesoft.co.uk
Mon Jun 4 09:45:21 UTC 2007
Oh, and I also update the #go method to return directly rather than use
#answer:
John Thornborrow wrote:
> I've removed the self call: invoke and it now works beatifully.
>
> Just for reference; I've changed to this:
>
> ---
> initialRequest: aRequest
> | url controller |
> super initialRequest: aRequest.
> url _ aRequest url copyFrom: (self defaultPath size) to: (aRequest
> url size).
> controller _ PineSoftWebController new uri: url.
> self registry at: 'content' put: controller go.
> ---
>
> Many thanks,
>
> John.
> www.pinesoft.co.uk
>
> John Thornborrow wrote:
>
>> The #controller returns an instance of my own-made controller class.
>> This class returns (via #answer:) an instance of the subcomponent to be
>> rendered.
>> The dictionary is simply a registry, within my
>> RootClass>>#renderContentOn: method, I use:
>>
>> ---
>> html render: (self registry at: 'content')
>> ---
>>
>> I did not know it broke initialisation! I thought that would only happen
>> if I called #isolate: like so:
>>
>> ---
>> self isolate: [
>> self call: controller]
>> ---
>>
>> Thanks,
>> John
>>
>> www.pinesoft.co.uk
>>
>> Lukas Renggli wrote:
>>
>>
>>>> self registry at: 'content' put: (self call: controller)
>>>>
>>>>
>>> I don't understand what you put into that dictionary? #call: does not
>>> return immediately and will break the initialization of your session.
>>> I guess this is also the reason for the strange behavior you encounter
>>> with the URL.
>>>
>>> If I understand your intention correctly, this should be written as:
>>>
>>> self registry at: 'content' put: controller.
>>> self show: controller.
>>>
>>>
>>>
>>>> updateUrl: aUrl
>>>> aUrl addToPath: self content url
>>>>
>>>>
>>> Don't forget to call super, just in case ...
>>>
>>> Lukas
>>>
>>>
>>
>> Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA
>>
>>
>>
>> This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
>>
>> _______________________________________________
>> Seaside mailing list
>> Seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>>
>>
>>
>>
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
>
>
More information about the Seaside
mailing list