returning a response in seaside 2.9

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

returning a response in seaside 2.9

muthu.kc
Hi All!

In my application (using seaside 2.8) I'm using WAsession>>returnResponse: to return a custom response to add Nginx specific headers for direct downloads. In seaside 2.9 , this seems to be deprecated. How to do the same in seaside 2.9?.

Thanks in advance.

Muthu.

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

Re: returning a response in seaside 2.9

Lukas Renggli
In Seaside 2.9 the response object is created at the beginning of the
request processing by the server adaptor. This has various advantages,
among others it avoids unnecessary copying of the response body,
allows streaming and prevents the need of unnecessary redirects when
adding cookies.

The response object (similar to the request, session, application,
etc.) can be accessed through the the current request context. The
following example would respond with a text file:

  self requestContext response
    contentType: WAMimeType textPlain;
    nextPutAll: 'Hello World';
    respond

Cheers,
Lukas

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

Re: returning a response in seaside 2.9

muthu.kc


On Wed, May 20, 2009 at 5:58 PM, Lukas Renggli <[hidden email]> wrote:
In Seaside 2.9 the response object is created at the beginning of the
request processing by the server adaptor. This has various advantages,
among others it avoids unnecessary copying of the response body,
allows streaming and prevents the need of unnecessary redirects when
adding cookies.

The response object (similar to the request, session, application,
etc.) can be accessed through the the current request context. The
following example would respond with a text file:

 self requestContext response
   contentType: WAMimeType textPlain;
   nextPutAll: 'Hello World';
   respond

Thanks for the explanation and the snippet.  It is working now.
 
   Muthu
   
 



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside