[plt-scheme] servlet2.ss, servlet.ss, etc.

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Tue Mar 27 14:56:55 EDT 2007

Hmm, it works in v369 on OS X. I don't have access to an XP machine to
test, so perhaps it does not work? When I get back to Brown, I'll have
to double check.

Jay

On 3/27/07, Ethan Herdrick <info at reatlas.com> wrote:
> Yes, I just pasted what you wrote into the definitions window of
> DrScheme and executed it.  I also tried saving it with the expected
> file name (servlet-env-test.ss); this made no difference.
>
> I have tried this on two machines with the same result.  Both are
> running DrScheme v360 on Windows XP.
>
>
> On 3/27/07, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
> > Hmm, what version of DrScheme scheme are you using? You just wrote
> > that in DrScheme, then pressed `Execute' and got this error? Or, did
> > you run the plt-web-server from the command-line/etc?
> >
> > Jay
> >
> > On 3/26/07, Ethan Herdrick <herdrick at gmail.com> wrote:
> > > OK, that does answer my question, thanks.  But I'm getting an error
> > > from the code you sent.
> > >
> > > When I execute it, the web server is started and a browser is opened,
> > > but the browser is pointed to:
> > > http://localhost:8000/servlets/standalone.ss  which shows this error:
> > > "Servlet didn't load. open-input-file: cannot open input file:
> > > "C:\Program Files\PLT\collects\web-server\default-web-root\.\servlets\standalone.ss"
> > > (The system cannot find the file specified.; errno=2)"
> > >
> > > When I tried pointing the browser to the file containing the code you
> > > sent, I got:  "Servlet didn't load. dynamic-require: name is not
> > > provided: interface-version by module: |,c:\program
> > > files\plt\collects\web-server\default-web-root\servlets\servlet-env-test|"
> > >
> > > Where does the 'standalone.ss' filename come from?  Shouldn't the
> > > browser be going to
> > > "http://localhost:8000/servlets/servlet-env-test.scm" instead?
> > >
> > > What am I doing wrong?
> > >
> > > Any help is appreciated.
> > > -Ethan
> > >
> > > When I execute the code you
> > > On 3/26/07, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
> > > > I'm not sure about the paper, but the basic thing that those modules
> > > > do is run the web-server embedded in DrScheme. You can still do that
> > > > with the following code:
> > > >
> > > > --- Copied from another message ----
> > > >
> > > > One thing you can do to run the web-server from within DrScheme is to
> > > > use the (lib "servlet-env.ss" "web-server" "tools") library. Here's an
> > > > example:
> > > >
> > > > (module servlet-env-test mzscheme
> > > >  (require (lib "servlet-env.ss" "web-server" "tools"))
> > > >
> > > >  ; request-number : str -> num
> > > >  (define (request-number which-number)
> > > >   (string->number
> > > >    (extract-binding/single
> > > >     'number
> > > >     (request-bindings (send/suspend (build-request-page which-number))))))
> > > >
> > > >  ; build-request-page : str -> str -> response
> > > >  (define (build-request-page which-number)
> > > >   (lambda (k-url)
> > > >     `(html (head (title "Enter a Number to Add"))
> > > >            (body ([bgcolor "white"])
> > > >                  (form ([action ,k-url] [method "post"])
> > > >                        "Enter the " ,which-number " number to add: "
> > > >                        (input ([type "text"] [name "number"] [value ""]))
> > > >                        (input ([type "submit"] [name "enter"] [value
> > > > "Enter"])))))))
> > > >  #;(on-web
> > > >  `(html (head (title "Sum"))
> > > >         (body ([bgcolor "white"])
> > > >               (p "The sum is "
> > > >                  ,(number->string (+ (request-number "first")
> > > > (request-number "second")))))))
> > > >
> > > >  (on-web (+ (request-number "first") (request-number "second"))))
> > > >
> > > > When you use the `on-web' function, a temporary server is run from
> > > > DrScheme on port 8080 and a browser window is opened to a temporary
> > > > servlet. This should help you test servlets from DrS.
> > > >
> > > > On 3/25/07, Ethan Herdrick <info at reatlas.com> wrote:
> > > > > Hi
> > > > >
> > > > > I've got a question about Matthias' remarkable 2002 paper, "Developing
> > > > > Interactive Web Programs" (here:
> > > > > http://www.ccs.neu.edu/scheme/pubs/afp2002-f.ps).
> > > > >
> > > > > Does any of the code described in the paper work anymore?  I notice it
> > > > > can be found in PLT/collects/htdp/servlet2.ss but it doesn't seem to
> > > > > work.  Has it been superseded by servlet.ss?  Most of the (names of)
> > > > > functions defined in htdp/servlets2.ss seem to be there.  (There's no
> > > > > "inform" function in servlet.ss, though.)
> > > > >
> > > > > Thanks in advance.
> > > > >
> > > > > -Ethan
> > > > > _________________________________________________
> > > > >   For list-related administrative tasks:
> > > > >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > > > >
> > > >
> > > >
> > > > --
> > > > Jay McCarthy <jay.mccarthy at gmail.com>
> > > > http://jay.teammccarthy.org
> > > >
> > >
> >
> >
> > --
> > Jay McCarthy <jay.mccarthy at gmail.com>
> > http://jay.teammccarthy.org
> >
>


-- 
Jay McCarthy <jay.mccarthy at gmail.com>
http://jay.teammccarthy.org


Posted on the users mailing list.