[plt-scheme] Module-based web servlet examples

From: Norman Gray (norman at astro.gla.ac.uk)
Date: Tue Oct 17 10:49:34 EDT 2006

Jens, hello.

On 2006 Oct 17 , at 15.24, Jens Axel Søgaard wrote:

> It is more likely it is due to different versions. I ran the
> eaxmples on 352.6.

I'm using 352, but I don't know what minor version.  I re-downloaded  
it from plt-scheme.org just a couple of days ago, not from the pre- 
release area.  Do I take it that 352.x are pre-releases of the next  

> Note: If you have installed 352.6 as a preview version, be careful
> that you start the corresponding web-server-text and not the
> default one

These were with plt-web-server-text.

>>          (body (h1 "Minimal servlet")
>>                (p ,(format "~s" w))))))
>> )
>> But replacing the last item in the Xexpr by (p ,w) hangs in the  
>> way I described.  That is, it was the (td ,(request-uri rq)) in my  
>> original version that was causing the trouble.
>> It appears, therefore, that the code translating the Xexpr to XML  
>> might be a little fragile, at least on this platform (a platform  
>> dependency here is surely surprising...).
> A wibble-struct is not allowed as part of an Xexpr, which is
> what you get with: (p ,w). Instead write a wibble->string and
> use (p ,(wibble->string w)).

Oh, indeed, and I used a silly structure to confirm that it wasn't  
something odd in the specific structure being returned by REQUEST-URI.

What I meant -- sorry for not being clearer -- was that the behaviour  
in the presence of bad input wasn't helpful.  If something can't be  
transformed to XML, then producing something like "garbled" or '(),  
or even throwing an exception, would be better than (whatever it is  
that results in) simply apparently hanging.  Though the minor  
difference in versions could indeed explain this.

> I think the definition of request changed from the official 352 and
> the SVN version 352.6 I am using. If you stick to the documentation
> in the HelpDesk everything ought to fit together.

Righto -- that at least postpones some confusion on my part.

Thanks again for your help.

All the best,


Norman Gray  /  http://nxg.me.uk
eurovotech.org  /  University of Leicester, UK

Posted on the users mailing list.