[plt-scheme] Requests in plt-web-server
Jens advice is good, but your problem is much simpler: You're using
quasiquote wrong.
> `(html
> (body (p (format "~a" (request-bindings initial-request))))))))
should be
> `(html
> (body (p ,(format "~a" (request-bindings initial-request))))))))
Notice the "," before the "(format" -- this is the `antiquote' that
evaluates the expression and splices in the result.
Jay
On Thu, Feb 21, 2008 at 9:00 AM, Justin Paston-Cooper
<paston.cooper at gmail.com> wrote:
> Hello. I've recently been developing an article-writing website with
> plt-web-server, and I've come across a problem with url queries. My code for
> the page is:
>
> (module post
> mzscheme
>
> (require (lib "servlet.ss" "web-server"))
>
> (provide start interface-version timeout)
>
> (define interface-version 'v1)
> (define timeout +inf.0)
>
> (define (start initial-request)
> (send/finish
> `(html
> (body (p (format "~a" (request-bindings initial-request))))))))
>
> When I go to http://localhost:8080/servlets/post.ss?x=2 , all I get is:
>
> ~a&initial-request;
>
> . This is just a test to see if the bindings environment exists. All I
> really want, is the value of x. Is there anything that I am doing wrong
> here? Thank you.
>
> Justin Paston-Cooper
>
> _________________________________________________
> 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