我尝试实现一个基于 Hunchentoot 的简单帖子示例。
这是代码:
(define-easy-handler (test :uri "/test") ()
(with-html-output-to-string (*standard-output* nil :prologue t :indent t)
(:html
(:body
(:h1 "Test")
(:form :action "/test2" :method "post" :id "addform"
(:input :type "text" :name "name" :class "txt")
(:input :type "submit" :class "btn" :value "Submit"))))))
(define-easy-handler (test2 :uri "/test2") (name)
(with-html-output-to-string (*standard-output* nil :prologue t :indent t)
(:html
(:body
(:h1 name)))))
我可以正确连接到http://127.0.0.1:8080/test并查看文本输入表单。但是当我提交文本时,我会得到一个空白页面,我希望在该页面上显示文本输入中给出的标题。
不知道是什么问题,有人可以建议吗?