[racket] Racket web servlets, doctype and planet libraries

From: Markku Rontu (markku.rontu at iki.fi)
Date: Mon Oct 11 14:47:29 EDT 2010

On Tue, Oct 5, 2010 at 12:59 AM, Jay McCarthy <jay.mccarthy at gmail.com>wrote:

> On Sat, Oct 2, 2010 at 3:20 PM, Markku Rontu <markku.rontu at iki.fi> wrote:
> > Hello everybody,
> >
> > I was trying to make some servlets recently and ran into two problems.
> First
> > it was not clear in the documentation how the doctype should be declared
> for
> > random servlets? I didn't want to make a html template based servlet to
> > include the doctype. I'd rather create the main parts of the (x)html
> pages
> > with xexprs in Racket code. What do I need to do?
>
> I would use make-xexpr-response
>
>
> http://docs.racket-lang.org/web-server/http.html#(def._((lib._web-server/http/response-structs..rkt)._make-xexpr-response))<http://docs.racket-lang.org/web-server/http.html#%28def._%28%28lib._web-server/http/response-structs..rkt%29._make-xexpr-response%29%29>
>
> and maybe add the byte string doc-type you want to the result body.
> Maybe I could add an option for a byte pre-amble to the body that
> comes in the response. Would that be more useful?
>

Well the XML, charset and doctype preamble would be useful for conforming
documents. Also since there are some intricacies with the XHTML support in
browsers, it would be nice to slowly collect all the gotchas into Racket or
Planet libraries anyway. They should really have to be developed only once
ever :)

-Markku
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20101011/785b3f53/attachment.html>

Posted on the users mailing list.