From: Haris Bogdanovi� on
Hi.

I wrote a cgi script like this:

------------------------------------------

#!c:/lisp/clisp/clisp.exe

(load "c:/lisp/clisp/asdf.lisp")
(push "c:/lisp/clisp/asdf-reg/cl-who/cl-who" asdf:*central-registry*)
(asdf:oos 'asdf:load-op 'cl-who)


(defpackage :a
(:use :cl :cl-who))

(in-package :a)

(with-html-output (*standard-output* nil :indent t)
(:html
(:head
(:title "Test page"))
(:body
(:p "CL-WHO"))))

-------------------------------------------------------------

and page looks like this:

---------------------------

<html>
<head>
<title>
Test page
</tiitle>
</head>
<body>
<p>
CL-WHO
</p>
</body>
</html>

-----------------------------

instead of just

----------------------
CL-WHO
----------------------

It looks like apache took literally this html code ?


From: Haris Bogdanovi� on
Whole html code is wrapped in double quotes when output in emacs.
How to correct that ?

Thanks


From: RG on
In article <hs6iib$bt9$1(a)gregory.bnet.hr>,
"Haris Bogdanoviæ" <fbogdanovic(a)xnet.hr> wrote:

> Hi.
>
> I wrote a cgi script like this:
>
> ------------------------------------------
>
> #!c:/lisp/clisp/clisp.exe
>
> (load "c:/lisp/clisp/asdf.lisp")
> (push "c:/lisp/clisp/asdf-reg/cl-who/cl-who" asdf:*central-registry*)
> (asdf:oos 'asdf:load-op 'cl-who)
>
>
> (defpackage :a
> (:use :cl :cl-who))
>
> (in-package :a)
>
> (with-html-output (*standard-output* nil :indent t)
> (:html
> (:head
> (:title "Test page"))
> (:body
> (:p "CL-WHO"))))
>
> -------------------------------------------------------------
>
> and page looks like this:
>
> ---------------------------
>
> <html>
> <head>
> <title>
> Test page
> </tiitle>
> </head>
> <body>
> <p>
> CL-WHO
> </p>
> </body>
> </html>
>
> -----------------------------
>
> instead of just
>
> ----------------------
> CL-WHO
> ----------------------
>
> It looks like apache took literally this html code ?

You need to output a CONTENT-TYPE header. Try doing this as the first
thing in your script:

(format t "Content-type: text/html~%~%")

rg
From: RG on
In article <hs6j2r$cu1$1(a)gregory.bnet.hr>,
"Haris Bogdanoviæ" <fbogdanovic(a)xnet.hr> wrote:

> Whole html code is wrapped in double quotes when output in emacs.
> How to correct that ?
>
> Thanks

That is to be expected. The HTML code is a string, and when Lisp prints
a string it puts quotes around it. YOU can print a string without
quotes by using, for example, the PRINC function instead of the PRINT
function, e.g.:

? (princ "foo")
foo
"foo"
?

Note that it appears that foo was printed twice, and indeed it was. The
first time it was printed by your invocation of the PRINC function (and
hence has no quotes) and the second time it was printed by Lisp as the
last step in the READ-EVAL-PRINT loop (because PRINC returns its
argument), and READ-EVAL-PRINT loop always uses PRINT, not PRINC.

rg
From: Haris Bogdanovi� on
> You need to output a CONTENT-TYPE header. Try doing this as the first
> thing in your script:
>
> (format t "Content-type: text/html~%~%")

Thanks, it renders a web page correctly now.


 |  Next  |  Last
Pages: 1 2
Prev: 1e-7 evaluates to 0
Next: hunchentoot start