2014-12-02 2 views
1

웹 페이지를 작성할 때 공통 리스프를 사용하여 빌드했습니다. 그러나 내가 얻는 것은 웹 페이지의 소스 코드입니다. 그러나 이맥스에 웹 페이지를 복사하고 다시 열면 작동합니다. 나는 무엇이 잘못되었는지 모른다. 혀짤배기에서내가 웹을 구축하기 위해 리스프를 사용할 때 뭔가 잘못되었습니다.

내 코드이 잘못 보이는

(defmacro standard-page ((&key title) &body body) 

(with-html-output-to-string(*standard-output* nil :prologue t :indent t) 

(:html :xmlns "http://www.w3.org/1999/xhtml" 
    :xml\:lang "en" 
    :lang "en" 
    (:head 
    (:meta :http-equiv "Content-Type" :content "text/html;charset=utf-8") 
    (:title ,title) 
    (:link :type "text/css" :rel "stylesheet" :href "/site.css")) 
    (:body 
    ,@body)))) 

(hunchentoot:define-easy-handler (hello :uri "/hello") (name) 
    (setf (hunchentoot:content-type*) "text/plain") 
    (standard-page (:title "something new") 
      (:h1 "can i do this?"))) 
+0

웹 서버가 Common Lisp을 실행하도록 구성되어 있습니까? – Chris

답변

2

입니다 :

(setf (hunchentoot:content-type*) "text/plain") 

나는 그 text/html 대신 text/plain해야한다고 생각합니다.

+0

네 말이 맞아. 많이 감사합니다. – zqy787

관련 문제