Version: 4.1.3
2.3 Common Contracts
| (require web-server/servlet/servlet-structs) |
"servlet/servlet-structs.ss" provides a number of contracts for use in servlets.
| k-url? : contract? |
Equivalent to string?.
Example: "http://localhost:8080/servlets;1*1*20131636/examples/add.ss"
| response-generator/c : contract? |
Equivalent to (-> k-url? response?).
Example:
| (lambda (k-url) |
| `(html |
| (body |
| (a ([href ,k-url]) |
| "Click Me to Invoke the Continuation!")))) |
| expiration-handler/c : contract? |
Equivalent to (or/c false/c (-> request? response?)).
Example:
| (lambda (req) |
| `(html (head (title "Expired")) |
| (body (h1 "Expired") |
| (p "This URL has expired. " |
| "Please return to the home page.")))) |
| embed/url/c : contract? |
Equivalent to (opt-> ((-> request? any/c)) (expiration-handler/c) string?).
This is what send/suspend/dispatch gives to its function argument.