1 Running the Web Server
2 Scheme Servlets
3 Web Language Servlets
4 Configuration
5 Dispatchers
6 Web Config Unit
7 Web Server Unit
8 Continuation Managers
9 Internal
10 Troubleshooting
11 Acknowledgements
Index
On this page:
redirect-to
redirection-status?
permanently
temporarily
see-other
with-errors-to-browser
Version: 4.0.2

 

2.7 Helpers

 (require web-server/servlet/helpers)

"servlet/helpers.ss" provides functions built on "servlet/web.ss" that are useful in many servlets.

(redirect-to

 

uri

 

 

 

 

 

 [

perm/temp

 

 

 

 

 

 

#:headers headers])

 

 

response?

  uri : string?

  perm/temp : redirection-status? = temporarily

  headers : (listof header?) = (list)

Generates an HTTP response that redirects the browser to uri, while including the headers in the response.

(redirection-status? v)  boolean?

  v : any/c

Determines if v is one of the following values.

permanently : redirection-status?

A redirection-status? for permanent redirections.

temporarily : redirection-status?

A redirection-status? for temporary redirections.

see-other : redirection-status?

A redirection-status? for "see-other" redirections.

(with-errors-to-browser

 

send/finish-or-back

 

 

 

 

 

 

thunk)

 

 

any

  send/finish-or-back : (response? . -> . void?)

  thunk : (-> any)

Calls thunk with an exception handler that generates an HTML error page and calls send/finish-or-back.