LSP

LSP (Lisp Server Pages) is a small library that allows you to embed Lisp code in HTML to create dynamic web pages, similar to the way that JSP lets you embed Java in HTML.

LSP is copyright I/NET and is licensed under the MIT License. It was written by John Wiseman.

Download ASDF package from http://lemonodor.com/code/lsp_1.1.tar.gz

LSP is designed to work with a separate web server library. The code comes with support for both the AllegroServe and Araneida servers, but it shouldn't be difficult to add support for other libraries (see lsp-aserve.lisp and lsp-allegroserve.lisp from the distribution for examples).

LSP itself should be portable ANSI Lisp code that will run in any Lisp implementation.

Example of publishing an LSP file:

(publish-lsp :path "/temperature.html"
             :file "/Users/wiseman/src/temperature.lsp"
             :server *my-server-or-http-listener*)

Example of an LSP file:



LSP Example (AllegroServe)


LSP Example

User Agent

<%= (:princ-safe (or (net.aserve:header-slot-value request :user-agent) "None.")) %>

Referrer

<%= (:princ-safe (or (net.aserve:header-slot-value request :referer) "None.")) %>

Query Variables

<% (let ((queries (request-query request))) (if (null queries) (html (:tr (:td "None."))) (dolist (query queries) (html (:tr (:td (:princ-safe (car query))) (:td (:princ-safe (cdr query)))))))) %>

Loop Of Dynamism

<% (dotimes (i (+ (random 10) 1)) %> Hi!
<% ) %>

CL-EMB uses some code from LSP, but does more.

Hunchentoot LSP is a port of LSP that target the Hunchentoot webserver

See http://sourceforge.net/projects/lsp for a more serious attempt at doing this right, by Sunil Mishra and Tim Bradshaw.


This page is linked from: Hunchentoot LSP  

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively