[plt-scheme] servlets served by a standalone executable

From: Anton van Straaten (anton at appsolutions.com)
Date: Tue Oct 25 20:41:15 EDT 2005

I'm having trouble getting a servlet to work when the web server is 
running as a standalone executable.  I successfully did this using v208 
last year.  Upgrading the same system to 299.400, I'm not able to get 
servlets to work.  I'm building the executable using "mzc --gui-exe". 
I'm currently getting the following error when attempting to invoke a 
servlet from a browser, whether I use a URI like "/servlets/foo.scm" or 
"/servlets/foo.zo":

"servlet-helpers.ss" broke the contract
   (->
    request?
    (union
     (listof
       (cons/c symbol? (union string? bytes?)))
     string?))
it had with "request-structs.ss" on request-bindings/raw; expected 
<request?>, given: #<struct:request>

What do I need to do to make this work?  Am I supposed to compile the 
servlet into the executable somehow?  (For 208, I didn't have to do 
anything like that.)

***

BTW, this reminded me that it would be nice to have a feature similar to 
that of J2EE servlets, where a servlet is just specified by an entry in 
a config file, which maps an arbitrary URL to a Java class.  In PLT's 
case, the mapping would presumably be between a URL and a module which 
implements the servlet interface, so e.g. a config entry that might look 
something like this would expose a servlet:

(servlet "/arbitrary/path" (lib "my-servlet.ss" "mycollect"))

Anton


Posted on the users mailing list.