► |  | Web Server: PLT HTTP Server

1 | Running the Web Server
2 | Writing Servlets
3 | Extending the Web Server
4 | Troubleshooting and Tips
5 | Acknowledgements
| Index

► | 2 | Writing Servlets

2.1 | Defining a Servlet
2.2 | APIs
2.3 | Common Contracts
2.4 | HTTP
2.5 | Web Interaction
2.6 | Stateless Web Interaction
2.7 | Web Cells
2.8 | File Boxes
2.9 | Stateless Web Parameters
2.10 | Formlets
2.11 | Templates
2.12 | Continuation Managers

▼ | 2.10 | Formlets

2.10.1 | Basic Formlet Usage
2.10.2 | Syntactic Shorthand
2.10.3 | Functional Usage
2.10.4 | Predefined Formlets
2.10.5 | Utilities

On this page:

send/ formlet
embed-formlet

Version: 4.1.4
top← prev up next →

##### 2.10.5`` Utilities

(require web-server/formlets/servlet)

A few utilities are provided for using formlets in Web applications.

(send/formlet f [#:wrap wrapper]) → any/c
f : (formlet/c any/c)

| wrapper |  | : |  | (xexpr? . -> . response?)

=

(lambda (form-xexpr)
`(html (head (title "Form Entry"))
(body ,form-xexpr)))

Uses send/suspend to send f’s rendering (wrapped in a FORM tag whose action is the continuation URL (wrapped again by wrapper)) to the client. When the form is submitted, the request is passed to the processing stage of f.

(embed-formlet embed/url f) → xexpr?
embed/url : embed/url/c
f : (formlet/c any/c)

Like send/formlet, but for use with send/suspend/dispatch.

top← prev up next →