Serving images from HttpView2

Jan B. Krejci jbk at umim.net
Wed Sep 1 13:48:35 UTC 2004


Hi all,

I'm surprised again and again, how simple the life can be with Squeak :)

Recently, I've asked Goran to help me, because I was not able to get a
dynamic image (i.e. some Morph's actual look) from Squeak using
HttpView2 so it could be displayed in browser.

The patch Goran has sent me almost immediately consisted of just one
"asString":

!HttpResponse methodsFor: 'responding' stamp: 'gk 8/31/2004 23:41'!
pvtWriteContentsOn: aStream
	| chunkSize cnts |
	chunkSize _ self responseChunkSize.
	cnts _ self contents.

	[cnts atEnd] whileFalse: 
		[aStream nextPutAll: (cnts next: chunkSize)
			asString "<== THIS ONE!"; flush]! !

And voila! Now I am able to write url methods like:

pic
	^ World.

Marvelous. God bless Goran and Squeak and everyone...

,:jbk:.
Jan B. Krejci




More information about the Squeak-dev mailing list