Hello again, Its gonna be a flurry from me today. I've successfully used the pragma alogn with RESPONSE.write() to stream a page to a browser.... I have two questions: 1) I haven't done more work outside of MSIE 6. Is this method of streaming working on all broswers? 2) It seems that if you write a page, you have to write 100% no less of the page otherwise the Wrtie() masks any normal html. Is there a way to do both? i.e Use RESPONSE-write() to immeditaley put up you interface, and then have the content come from normal html. Thanks Paz
Where can I find more info on using RESPONSE.write() ? Searched both mother zope.org and nipltd. I'm basically looking for a better solution than: <meta name="refresh" content="5; url=<dtml-var URL>">
Hello again,
Its gonna be a flurry from me today. I've successfully used the pragma alogn with RESPONSE.write() to stream a page to a browser....
I have two questions:
1) I haven't done more work outside of MSIE 6. Is this method of streaming working on all broswers?
2) It seems that if you write a page, you have to write 100% no less of the page otherwise the Wrtie() masks any normal html. Is there a way to do both?
i.e Use RESPONSE-write() to immeditaley put up you interface, and then have the content come from normal html.
Thanks Paz
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Um... the only thing you really need to know is to first set your header: <dtml-call "RESPONSE.setHeader('Pragma', 'No-cache')"> and then use: <dtml-call "RESPONSE.write(' <htmlCode> ')"> Make sure you escape your characters: ' = \' " = \" (Incidentally I cannot make work, although it should) I found this info from surfing the lists and collecting. I also would like to know more about it other than a very rude 'how' Paz -----Original Message----- From: Peter Bengtsson [mailto:mail@peterbe.com] Sent: Wednesday, August 29, 2001 6:19 PM To: Paz; Zope@zope.org Subject: Re: [Zope] RESPONSE.write() Where can I find more info on using RESPONSE.write() ? Searched both mother zope.org and nipltd. I'm basically looking for a better solution than: <meta name="refresh" content="5; url=<dtml-var URL>">
Hello again,
Its gonna be a flurry from me today. I've successfully used the pragma alogn with RESPONSE.write() to stream a page to a browser....
I have two questions:
1) I haven't done more work outside of MSIE 6. Is this method of streaming working on all broswers?
2) It seems that if you write a page, you have to write 100% no less of the page otherwise the Wrtie() masks any normal html. Is there a way to do both?
i.e Use RESPONSE-write() to immeditaley put up you interface, and then have the content come from normal html.
Thanks Paz
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Peter Bengtsson writes:
Where can I find more info on using RESPONSE.write() ?
Searched both mother zope.org and nipltd. From "ZPublisher.HTTPResponse.write":
def write(self,data): """\ Return data as a stream HTML data may be returned using a stream-oriented interface. This allows the browser to display partial results while computation of a response to proceed. The published object should first set any output headers or cookies on the response object. Note that published objects must not generate any errors after beginning stream-oriented output.
I'm basically looking for a better solution than: <meta name="refresh" content="5; url=<dtml-var URL>"> That's no use case for "RESPONSE.write"!
Dieter
Paz writes:
... streaming with "RESPONSE.write"....
1) I haven't done more work outside of MSIE 6. Is this method of streaming working on all broswers? I use it successfully with Netscape 4.x and IE 5.x.
2) It seems that if you write a page, you have to write 100% no less of the page otherwise the Wrtie() masks any normal html. Is there a way to do both? Any response through a "Keep-Alive" channel needs to know when the response is complete (such that the channel can be reused). Thus, they use the "Content-Length" response header to indicate how long the response body is. You must send exactly that many bytes. Only then the message sent is correctly associated with the response.
i.e Use RESPONSE-write() to immeditaley put up you interface, and then have the content come from normal html. ???? This sentence seems a bit difficult for me to understand....
You know you must ensure that after the first "RESPONSE.write" you must be sure only to send response data. You must not generate any exceptions or stream other data into the response channel (as explained above). Dieter
Thanks Dieter, That's one to archive.
i.e Use RESPONSE-write() to immeditaley put up you interface, and then have the content come from normal html. ???? This sentence seems a bit difficult for me to understand....
Through use of <dtml-var item> you can construct a page from several parts. A rough templating scheme is adhered by simply using the right sucession of vars in your Document. Say you want to build a site that streams. Since the rule is if using write(), you must do the WHOLE thing with write, How can you build it so you aren't rewriting all of your html tags to cryptic stuff like: <dtml-call "RESPONSE.write('<html><head>\n <link rel=\'stylesheet\' type=\'text/css\' href=\'/Interface/' + data.get('interface') + '/Css/Msie\'>\n')"> What I would like to do is generally say: RESPONSE.write(_.getitem('page')) Could this be possible? Thanks, Paz
Paz writes:
What I would like to do is generally say: RESPONSE.write(_.getitem('page')) That's what happens without "RESPONSE.write"! At least, if you replace "_.getitem('page')" with "_['page']").
The streaming protocol is *NOT* for this kind of use case, but for large objects (images, videos, audios) you want to stream to the client. Search the mailing list archives for a solution when you want to send partial pages to the client. Someone posted a solution for this based on a special "multipart" response. Search for "multipart" to locate the thread.... Dieter
participants (3)
-
Dieter Maurer -
Paz -
Peter Bengtsson