我试图回应我们从get参数name
获得的内容,但它总是响应
名:安培; REQ;&安培;名称;
使用网址
源代码是
(require web-server/servlet
web-server/servlet-env
web-server/http/bindings)
(define (lookup-binding req id)
(if (exists-binding? id (request-bindings req))
(extract-binding/single id (request-bindings req))
#f))
(provide/contract (my-app (request? . -> . response?)))
(define (my-app req)
(response/xexpr
'(html (head (title "Wizard!"))
(body (p "name:" ,(lookup-binding req 'name))))))
(serve/servlet my-app
#:launch-browser? #f
#:quit? #f
#:listen-ip #f
#:port 8080
#:servlet-path "/")