[Seaside] Accessing the Post body/content from an expired/cached page before initialRequest

Philippe Marschall philippe.marschall at gmail.com
Tue Mar 13 08:09:41 UTC 2012


Am 13. März 2012 06:59 schrieb Ramshreyas <ramshreyas.rao at gmail.com>:
> Dear all,
>
> I am developing a (non-commercial) web application for mobiles on
> Phar1.0/seaside30 (hosted on seaside-hosting for now, cheers to this
> brilliant service).
>
> I would like the user to bookmark a transaction page on her phone, add it to
> her home screen and use it like any other app. She will enter data for
> submission before any callbacks/page-loads are performed.
>
> This means that she will almost always enter data into a form on an expired
> page and submit.
>
> I find that the WARequest object available to me from
> RootTask>>initialRequest has its Post body stripped and is converted to a
> 'Get' request at that stage.
>
> Is this true? I am a newb, ( to web-development itself, seaside is my first
> framework! Avoided programming in general until I found, and fell in love
> with, smalltalk) so perhaps I simply don't understand how the information is
> encoded into the WARequest object, or in the Post method in general.
>
> I tried something like:
>
> RootTask>>initialRequest: aRequest
>
>    | expiredFormData |
>
>    expiredFormData := aRequest bodyDecoded (or aRequest postFields..,
> aRequest rawBody etc )
>
> The body is nil, as confirmed upon putting a halt here and inspecting the
> WARequest object. It also seems to have converted the original Post method
> into a Get. This would make sense given the instructions for 'recovering
> from an expired session' that use updateUrl (and hence Get)....

Are you using Comache or KomLight? Do you really need the whole body
or would the fields (WARequest >> #fields / #queryFields /
#postFields) work as well?

> When I (tentatively) examined the full stack, I found something that seemed
> to indicate the HTTPRequest is 'converted' to a 'native' request way before
> RootTask>>initialRequest is called - I'm out of my depth here, and am wary
> of monkeypatching the innards without some guidance.
>
> How would one capture Post data from an expired page and decode it? Where is
> the best place to intercept the incoming request?
>
> Thanks, and sorry if I am posting below the level of this forum!

Don't worry.

Cheers
Philippe


More information about the seaside mailing list