[plt-scheme] Web-server and servlet

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sat Apr 10 22:33:51 EDT 2004

On Apr 10, 2004, at 8:43 PM, schemer wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Hello,
>
> Thank you for all of your suggestions last time.
>
> Now I have read the documents about the Web-server and servlet and can 
> write
> some simple servlets. But I still have two problems:
>
> 1
>
> In the Help-Desk -- Documentation for the web-server collection, there 
> is
> one topic "Developing Servlets", which says "require the module servlet
> development library.  (require (lib "develop-servlet.ss"))".  Doing so
> raise the error : open-input-file: cannot open input file: "C:\Program
> Files\plt\collects\mzlib\develop-servlet.ss". I searched my hard disk 
> and
> still can't find a file with name"develop-servlet".
>

Use Pretty Big Scheme and the servlet.ss teachpack in htdp instead.
Greg is working on an alternative way of developing servlets. We're
all hoping on results soon.

> 2
>
> Using send/suspend, I can get a single input from a Web form. But how 
> to
> handle several inputs from a Web form? For example, the add.ss example 
> in
> DrScheme use two web page to get the two numbers to add. How two get 
> them
> in one form?
>
> (To Matthias: I didn't have any problem in using my mailbox. )

(let* ([one (send/suspend
              (lambda (one)
                `(form
                  ([action ,one][method "get"])
                  (p "Name:" (input ([name "first-name"][type "text"])))
                  (p "Pass Phrase:" (input ([name "log-phrase"][type 
"password"])))
                  (p "Your Mother's Maiden Name" (input ([name 
"mother-nme"][type "password"]))))))]
        [one-bindings (request-bindings one)]
        [first-name (assq 'first-name one-bindings)]
        [log-phrase (assq 'log-phrase one-bindings)]
        [mother-nme (assq 'mother-nme one-bindings)])
   (values first-name log-phrase mother-nme))

-- Matthias



Posted on the users mailing list.