From plh at golux.podzone.net Fri Dec 2 06:28:13 2011 From: plh at golux.podzone.net (PL Hayes) Date: Fri, 02 Dec 2011 06:28:13 +0000 Subject: [hunchentoot-devel] Help needed with changes since 1.1 Message-ID: <4ED86FFD.4090505@golux.podzone.net> Hi. My *extremely* simple website won't work with 1.2.1. and I've no idea why. All it consists of is this: (push (hunchentoot:create-folder-dispatcher-and-handler "/misc/" #p"/home/plh/misc-web/") hunchentoot:*dispatch-table*) but I just get the 'not found' error page when I try to visit any of the files in that directory. From hans.huebner at gmail.com Fri Dec 2 06:45:27 2011 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Fri, 2 Dec 2011 07:45:27 +0100 Subject: [hunchentoot-devel] Help needed with changes since 1.1 In-Reply-To: <4ED86FFD.4090505@golux.podzone.net> References: <4ED86FFD.4090505@golux.podzone.net> Message-ID: On Fri, Dec 2, 2011 at 7:28 AM, PL Hayes wrote: > My *extremely* simple website won't work with 1.2.1. and I've no idea > why. All it consists of is this: > > (push (hunchentoot:create-folder-dispatcher-and-handler > ? ? ? "/misc/" > ? ? ? #p"/home/plh/misc-web/") > ? ? ?hunchentoot:*dispatch-table*) > > but I just get the 'not found' error page when I try to visit any of the > files in that directory. Make sure that you are creating an easy-acceptor, not an acceptor when you use any of the easy handlers functionality. This is documented, too. Cheers, Hans From plh at golux.podzone.net Fri Dec 2 07:18:07 2011 From: plh at golux.podzone.net (PL Hayes) Date: Fri, 02 Dec 2011 07:18:07 +0000 Subject: [hunchentoot-devel] Help needed with changes since 1.1 In-Reply-To: References: <4ED86FFD.4090505@golux.podzone.net> Message-ID: <4ED87BAF.8060402@golux.podzone.net> On 02/12/11 06:45, Hans H?bner wrote: > On Fri, Dec 2, 2011 at 7:28 AM, PL Hayes wrote: >> My *extremely* simple website won't work with 1.2.1. and I've no idea >> why. All it consists of is this: >> >> (push (hunchentoot:create-folder-dispatcher-and-handler >> "/misc/" >> #p"/home/plh/misc-web/") >> hunchentoot:*dispatch-table*) >> >> but I just get the 'not found' error page when I try to visit any of the >> files in that directory. > > Make sure that you are creating an easy-acceptor, not an acceptor when > you use any of the easy handlers functionality. This is documented, > too. > > Cheers, > Hans That works fine. Thanks Hans! Just one more thing then: I did notice while (mis-)reading the documentation but successfully migrating my access and error message logging to file that there seems to be a spurious prefix (?acceptor-?) in various places: ... [Special variable] *acceptor* The current ACCEPTOR object in the context of a request. [Generic readers] acceptor-address acceptor => address acceptor-port acceptor => port ... Cheers, Paul From hans.huebner at gmail.com Fri Dec 2 07:48:07 2011 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Fri, 2 Dec 2011 08:48:07 +0100 Subject: [hunchentoot-devel] Help needed with changes since 1.1 In-Reply-To: <4ED87BAF.8060402@golux.podzone.net> References: <4ED86FFD.4090505@golux.podzone.net> <4ED87BAF.8060402@golux.podzone.net> Message-ID: Hi Paul, On Fri, Dec 2, 2011 at 8:18 AM, PL Hayes wrote: > I did notice > while (mis-)reading the documentation but successfully migrating my > access and error message logging to file that there seems to be a > spurious prefix (?acceptor-?) in various places: > > ... > [Special variable] > *acceptor* > > ? ?The current ACCEPTOR object in the context of a request. > > [Generic readers] > acceptor-address acceptor => address > acceptor-port acceptor => port > ... What do you mean by "spurious"? The readers that you quotes actually exist. Can you elaborate? Thanks, Hans From plh at golux.podzone.net Fri Dec 2 08:08:28 2011 From: plh at golux.podzone.net (PL Hayes) Date: Fri, 02 Dec 2011 08:08:28 +0000 Subject: [hunchentoot-devel] Help needed with changes since 1.1 In-Reply-To: References: <4ED86FFD.4090505@golux.podzone.net> <4ED87BAF.8060402@golux.podzone.net> Message-ID: <4ED8877C.5080107@golux.podzone.net> On 02/12/11 07:48, Hans H?bner wrote: > Hi Paul, > > On Fri, Dec 2, 2011 at 8:18 AM, PL Hayes wrote: >> I did notice >> while (mis-)reading the documentation but successfully migrating my >> access and error message logging to file that there seems to be a >> spurious prefix (?acceptor-?) in various places: >> >> ... >> [Special variable] >> *acceptor* >> >> The current ACCEPTOR object in the context of a request. >> >> [Generic readers] >> acceptor-address acceptor => address >> acceptor-port acceptor => port >> ... > > What do you mean by "spurious"? The readers that you quotes actually > exist. Can you elaborate? > > Thanks, > Hans > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel Sorry, my mistake: I see there is indeed nothing wrong now. Cheers, Paul. From gbs at google.com Wed Dec 7 16:16:23 2011 From: gbs at google.com (Gordon Sims) Date: Wed, 7 Dec 2011 11:16:23 -0500 Subject: [hunchentoot-devel] patch for fixing abort-request-handler's use of handler-done tag Message-ID: Here's a patch that changes abort-request-handler's use of handler-done tag to be consistent with the catch of it (and also consistent with the throw in handle-request). Before this patch is applied, using abort-request-handler causes this response, note there is no error message or backtrace. Internal Server Error

Internal Server Error

An error occured while processing your /stat/config/monitor.debug.eval.enabled request.

Error Message

ERROR

Backtrace

BACKTRACE

Hunchentoot 1.2.0 running on Clozure Common Lisp Version 1.7-r15010M (LinuxX8664)
After patch applied, error message and backtrace appear in the HTTP 500 response. -Gordon -------------- next part -------------- A non-text attachment was scrubbed... Name: abort-request-handler.patch Type: text/x-patch Size: 582 bytes Desc: not available URL: From sebyte at smolny.plus.com Mon Dec 12 14:07:56 2011 From: sebyte at smolny.plus.com (Sebastian Tennant) Date: Mon, 12 Dec 2011 14:07:56 +0000 Subject: [hunchentoot-devel] Subclassing ACCEPTOR Message-ID: Hi list, (make-package :vhost :use '(:common-lisp)) ;;; => # (in-package :vhost) (defclass vhost (tbnl:acceptor) ((tbnl::name :initform (error "Please give this VHOST a meaningful name.")))) ;;; => # (describe 'vhost) ;;; => VHOST::VHOST ;;; [symbol] ;;; ;;; VHOST names the standard-class #: ;;; Class precedence-list: VHOST, HUNCHENTOOT:ACCEPTOR, STANDARD-OBJECT, ;;; SB-PCL::SLOT-OBJECT, T ;;; Direct superclasses: HUNCHENTOOT:ACCEPTOR ;;; No subclasses. ;;; Direct slots: ;;; HUNCHENTOOT::NAME ;;; Initform: (ERROR "A virtual host must have a meaningful name.") (defvar *vhost1* (make-instance 'vhost)) ;;; => *VHOST1* <--- WHY NO ERROR ??? (describe *vhost1*) ;;; => # ;;; [standard-object] ;;; ;;; Slots with :INSTANCE allocation: ;;; PORT = 80 ;;; ADDRESS = NIL ;;; NAME = #:G1150 <--- this is what I want to prevent ;;; [...] Practical Common Lisp - page 214: "... if multiple classes specify an initform the new class uses the one from the most specific class. This allows a subclass to specify a different default value than the one it would otherwise inherit." What am I doing wrong here? Sebastian -- Emacs' AlsaPlayer - Music Without Jolts Lightweight, full-featured and mindful of your idyllic happiness. http://home.gna.org/eap From hans.huebner at gmail.com Mon Dec 12 14:54:18 2011 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Mon, 12 Dec 2011 15:54:18 +0100 Subject: [hunchentoot-devel] Subclassing ACCEPTOR In-Reply-To: References: Message-ID: Sebastian, the acceptor class has a :default-initargs clause, so the :initform that you've provided is never being looked at. Use a :default-initargs in your vhost class to override the inherited :name initarg. -Hans On Mon, Dec 12, 2011 at 3:07 PM, Sebastian Tennant wrote: > Hi list, > > ?(make-package :vhost :use '(:common-lisp)) > ?;;; => # > > ?(in-package :vhost) > > ?(defclass vhost (tbnl:acceptor) > ? ((tbnl::name > ? ? :initform > ? ? (error "Please give this VHOST a meaningful name.")))) > ?;;; => # > > ?(describe 'vhost) > ?;;; => VHOST::VHOST > ?;;; ? ? ?[symbol] > ?;;; > ?;;; ? ?VHOST names the standard-class #: > ?;;; ? ? ?Class precedence-list: VHOST, HUNCHENTOOT:ACCEPTOR, STANDARD-OBJECT, > ?;;; ? ? ? ? ? ? ? ? ? ? ? ? ? ? SB-PCL::SLOT-OBJECT, T > ?;;; ? ? ?Direct superclasses: HUNCHENTOOT:ACCEPTOR > ?;;; ? ? ?No subclasses. > ?;;; ? ? ?Direct slots: > ?;;; ? ? ? ?HUNCHENTOOT::NAME > ?;;; ? ? ? ? ?Initform: (ERROR "A virtual host must have a meaningful name.") > > ?(defvar *vhost1* (make-instance 'vhost)) > ?;;; => *VHOST1* ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <--- WHY NO ERROR ??? > > ?(describe *vhost1*) > ?;;; => # > ?;;; ? ? ?[standard-object] > ?;;; > ?;;; ? ?Slots with :INSTANCE allocation: > ?;;; ? ? ?PORT ? ? ? ? ? ? ? ? ? ? ?= 80 > ?;;; ? ? ?ADDRESS ? ? ? ? ? ? ? ? ? = NIL > ?;;; ? ? ?NAME ? ? ? ? ? ? ? ? ? ? ?= #:G1150 ? ?<--- this is what I want to prevent > ?;;; ? ?[...] > > Practical Common Lisp - page 214: > > ?"... if multiple classes specify an initform the new class uses the one from > ?the most specific class. ?This allows a subclass to specify a different > ?default value than the one it would otherwise inherit." > > What am I doing wrong here? > > Sebastian > -- > Emacs' AlsaPlayer - Music Without Jolts > Lightweight, full-featured and mindful of your idyllic happiness. > http://home.gna.org/eap > > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel From sebyte at smolny.plus.com Mon Dec 12 15:13:10 2011 From: sebyte at smolny.plus.com (Sebastian Tennant) Date: Mon, 12 Dec 2011 15:13:10 +0000 Subject: [hunchentoot-devel] Subclassing ACCEPTOR References: Message-ID: Quoth Hans H?bner : > the acceptor class has a :default-initargs clause, so the :initform that > you've provided is never being looked at. Use a :default-initargs in your > vhost class to override the inherited :name initarg. Ah. I see. I didn't think that would make any difference. This seems a little restrictive/clumsy to me. Is there a way of telling whether or not a superclass uses a :default-initargs clause without looking at the source? DESCRIBE doesn't help. Trial and error I suppose. Thanks by the way. Sebastian -- Emacs' AlsaPlayer - Music Without Jolts Lightweight, full-featured and mindful of your idyllic happiness. http://home.gna.org/eap From hans.huebner at gmail.com Mon Dec 12 15:19:19 2011 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Mon, 12 Dec 2011 16:19:19 +0100 Subject: [hunchentoot-devel] Subclassing ACCEPTOR In-Reply-To: References: Message-ID: On Mon, Dec 12, 2011 at 4:13 PM, Sebastian Tennant wrote: > This seems a little restrictive/clumsy to me. ?Is there a way of telling > whether or not a superclass uses a :default-initargs clause without looking at > the source? ?DESCRIBE doesn't help. ?Trial and error I suppose. None that I knew of. I tend to not use :initform for slots that are initialized by make-instance arguments. But that is just a matter of style and preference. -Hans From vsedach at gmail.com Tue Dec 13 04:15:15 2011 From: vsedach at gmail.com (Vladimir Sedach) Date: Mon, 12 Dec 2011 23:15:15 -0500 Subject: [hunchentoot-devel] #handlers section missing from the documentation Message-ID: Hello, There are several places in the documentation that reference the "handlers" section (as #handlers), but there's no longer a subchapter with that name. Vladimir From hans.huebner at gmail.com Tue Dec 13 10:49:52 2011 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Tue, 13 Dec 2011 10:49:52 +0000 Subject: [hunchentoot-devel] #handlers section missing from the documentation In-Reply-To: References: Message-ID: On Tue, Dec 13, 2011 at 4:15 AM, Vladimir Sedach wrote: > There are several places in the documentation that reference the > "handlers" section (as #handlers), but there's no longer a subchapter > with that name. Thanks for the report, I've fixed that. -Hans From fbogdanovic at xnet.hr Mon Dec 19 09:09:19 2011 From: fbogdanovic at xnet.hr (Haris Bogdanovich) Date: Mon, 19 Dec 2011 10:09:19 +0100 Subject: [hunchentoot-devel] log files Message-ID: <959C62019A26489DA36BF97773E59A73@komp> Hi. I forgot, how do I set error log and access log files ? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.huebner at gmail.com Mon Dec 19 09:47:37 2011 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Mon, 19 Dec 2011 04:47:37 -0500 Subject: [hunchentoot-devel] log files In-Reply-To: <959C62019A26489DA36BF97773E59A73@komp> References: <959C62019A26489DA36BF97773E59A73@komp> Message-ID: On Mon, Dec 19, 2011 at 4:09 AM, Haris Bogdanovich wrote: > I forgot, how do I set error log and access log files ? A good way to find out is to look at the manual: http://weitz.de/hunchentoot/#logging -Hans From fbogdanovic at xnet.hr Mon Dec 19 17:36:29 2011 From: fbogdanovic at xnet.hr (Haris Bogdanovich) Date: Mon, 19 Dec 2011 18:36:29 +0100 Subject: [hunchentoot-devel] log files References: <959C62019A26489DA36BF97773E59A73@komp> Message-ID: I started Hunchentoot by (make-instance 'acceptor :access-log-destination "c:/lisp/log-1.txt" :message-log-destination "c:/lisp/log-2.txt") and a page can not be displayed but I don't get some log in c:/lisp/log-1.txt or c:/lisp/log-2.txt ? From hans.huebner at gmail.com Mon Dec 19 18:12:49 2011 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Mon, 19 Dec 2011 19:12:49 +0100 Subject: [hunchentoot-devel] log files In-Reply-To: References: <959C62019A26489DA36BF97773E59A73@komp> Message-ID: On Mon, Dec 19, 2011 at 6:36 PM, Haris Bogdanovich wrote: > I started Hunchentoot by > (make-instance 'acceptor :access-log-destination "c:/lisp/log-1.txt" > :message-log-destination "c:/lisp/log-2.txt") > and a page can not be displayed but > I don't get some log in c:/lisp/log-1.txt or c:/lisp/log-2.txt ? I would trace hunchentoot:acceptor-log-message, acceptor-message-log-destination and cl:open and try to work from there. -Hans From fbogdanovic at xnet.hr Tue Dec 20 22:48:58 2011 From: fbogdanovic at xnet.hr (Haris Bogdanovich) Date: Tue, 20 Dec 2011 23:48:58 +0100 Subject: [hunchentoot-devel] log files References: <959C62019A26489DA36BF97773E59A73@komp> Message-ID: I did the following: (setf acc (make-instance 'acceptor)) (setf (acceptor-message-log-destination acc) "c:/log.txt") (acceptor-log-message acc :error "%s") and something is written in c:/log.txt it just states ERROR %s. How should look the format string ? I thought it has to do with format function but obviously it doesn't. Are there some instructions how to write format string ? From rm at tuxteam.de Tue Dec 20 23:24:43 2011 From: rm at tuxteam.de (rm at tuxteam.de) Date: Wed, 21 Dec 2011 00:24:43 +0100 Subject: [hunchentoot-devel] log files In-Reply-To: References: Message-ID: <20111220232443.GD20951@seid-online.de> On Tue, Dec 20, 2011 at 11:48:58PM +0100, Haris Bogdanovich wrote: > I did the following: > > (setf acc (make-instance 'acceptor)) > (setf (acceptor-message-log-destination acc) "c:/log.txt") > (acceptor-log-message acc :error "%s") ??? What's that format string supposed to be/do? > and something is written in c:/log.txt > it just states ERROR %s. > How should look the format string ? Depends on what you want it to do .. (acceptor-log-message acc :error "User ~A did something stupid~%" "Carl") > I thought it has to do with format function > but obviously it doesn't. > Are there some instructions how to write format string ? Besides the fine chapter on format in the Common Lisp Hyperspec? Maybe http://www.gigamonkeys.com/book/a-few-format-recipes.html. HTH, Ralf Mattes > > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel From fbogdanovic at xnet.hr Wed Dec 21 12:22:21 2011 From: fbogdanovic at xnet.hr (Haris Bogdanovich) Date: Wed, 21 Dec 2011 13:22:21 +0100 Subject: [hunchentoot-devel] log files References: <20111220232443.GD20951@seid-online.de> Message-ID: <496FEFDBAFF5429796BCB200CCA81CD6@komp> I tried to log message with all severity levels (acceptor-log-message acc :error "") (acceptor-log-message acc :info "") (acceptor-log-message acc :warning "") A page can not be opened but there is no any kind of message. Where is the problem ? From xach at xach.com Wed Dec 21 13:59:13 2011 From: xach at xach.com (Zach Beane) Date: Wed, 21 Dec 2011 08:59:13 -0500 Subject: [hunchentoot-devel] log files In-Reply-To: <496FEFDBAFF5429796BCB200CCA81CD6@komp> (Haris Bogdanovich's message of "Wed, 21 Dec 2011 13:22:21 +0100") References: <20111220232443.GD20951@seid-online.de> <496FEFDBAFF5429796BCB200CCA81CD6@komp> Message-ID: <87ehvyxbym.fsf@hangup.portland.xach.com> "Haris Bogdanovich" writes: > I tried to log message with all severity levels > > (acceptor-log-message acc :error "") > > (acceptor-log-message acc :info "") > (acceptor-log-message acc :warning "") > > A page can not be opened but there is no any kind of message. > Where is the problem ? Did you at any point call hunchentoot:start? Zach From fbogdanovic at xnet.hr Wed Dec 21 15:33:45 2011 From: fbogdanovic at xnet.hr (Haris Bogdanovich) Date: Wed, 21 Dec 2011 16:33:45 +0100 Subject: [hunchentoot-devel] log files References: <20111220232443.GD20951@seid-online.de><496FEFDBAFF5429796BCB200CCA81CD6@komp> <87ehvyxbym.fsf@hangup.portland.xach.com> Message-ID: <4342D19633D24A93B4CEB2FA5092974E@komp> Now I called start and there is some lizard on http://localhost Now when I call accept-log-message, nothing is written in c:/log.txt, I get the same output in repl but again without a message ? From tyler.smith at mail.mcgill.ca Thu Dec 22 22:51:46 2011 From: tyler.smith at mail.mcgill.ca (Tyler Smith) Date: Thu, 22 Dec 2011 17:51:46 -0500 Subject: [hunchentoot-devel] easy-handler outputs to REPL instead of client Message-ID: Hi, I'm trying to set up a simple sql-based website using cl-who, cl-sql and hunchentoot. I've got the basic cl-sql and cl-who parts working, but I'm having a trouble serving the pages with hunchentoot. The following works as expected: (ql:quickload :hunchentoot) (use-package :hunchentoot) (setf my-acceptor (start (make-instance 'hunchentoot:easy-acceptor :port 4242))) (define-easy-handler (tyler :uri "/tyler") () (with-html-output (*standard-output*) (:ul (:li "hi there again")))) After this, if I open localhost:4242/tyler in a browser I see my unordered list. However, with this: (define-easy-handler (tyler :uri "/tyler") () (multiple-value-bind (records fields) (select [genus] [species] :from "specimens") (loop for rec in records do (loop for label in fields for val in rec do (with-html-output (*standard-output*) (:dt :class label (str label)) (:dd :class label (str val))))))) When I browse to localhost:4242/tyler nothing appears in the browser, instead the html is printed in the REPL. If I evaluate just the (M-V-B ...) form without the enclosing (D-E-H ...) it outputs the html to the REPL as I expect. I have been following the examples in the hunchentoot docs, but I'm stumped as to why this doesn't work. What have I missed? Thanks, Tyler From info at jensteich.de Thu Dec 22 23:18:45 2011 From: info at jensteich.de (Jens Teich) Date: Fri, 23 Dec 2011 00:18:45 +0100 Subject: [hunchentoot-devel] easy-handler outputs to REPL instead of client In-Reply-To: References: Message-ID: <4EF3BAD5.2020104@jensteich.de> > (define-easy-handler (tyler :uri "/tyler") () > (multiple-value-bind (records fields) > (select [genus] [species] :from "specimens") > (loop for rec in records do > (loop for label in fields > for val in rec do > (with-html-output (*standard-output*) > (:dt :class label (str label)) > (:dd :class label (str val))))))) use with-html-output-to-string -jens From z_axis at 163.com Thu Dec 22 23:31:36 2011 From: z_axis at 163.com (z_axis) Date: Fri, 23 Dec 2011 07:31:36 +0800 Subject: [hunchentoot-devel] Does hunchentoot-cgi still work with the new hunchentoot ? In-Reply-To: <4EF3BAD5.2020104@jensteich.de> References: <4EF3BAD5.2020104@jensteich.de> Message-ID: I want to use hunchentoot to host a python CGI application. By searching, i found hunchentoot-cgi which exports a function called "create-cgi-dispatcher-and-handler". (defun create-cgi-dispatcher-and-handler (uri-prefix base-path &optional content-type) ;... ) I have tried: (pushnew (hunchentoot-cgi::create-cgi-dispatcher-and-handler "/cgi-bin/" "/" ) *dispatch-table* :test #'equal) When visiting http://127.0.0.1:8000/cgi-bin/nay.py, hunchentoot reports: Internal Server Error An error occured while processing your /cgi-bin/nay.py request. Error Message attempt to THROW to a tag that does not exist: HUNCHENTOOT-CGI::HANDLER-DONE Backtrace 0: (SB-DEBUG::MAP-BACKTRACE # :START 0 :COUNT 536870911) 1: (BACKTRACE 536870911 #) 2: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE-TO-STREAM #) 3: (HUNCHENTOOT::GET-BACKTRACE) 4: ((FLET #:LAMBDA769 :IN HUNCHENTOOT:HANDLE-REQUEST) #) 5: (SIGNAL #) 6: (ERROR SB-INT:SIMPLE-CONTROL-ERROR :FORMAT-CONTROL "attempt to THROW to a tag that does not exist: ~S" :FORMAT-ARGUMENTS (HUNCHENTOOT-CGI::HANDLER-DONE)) 7: (SB-KERNEL::UNSEEN-THROW-TAG-ERROR-HANDLER # #.(SB-SYS:INT-SAP #X293FF77C) # (144)) 8: (SB-KERNEL:INTERNAL-ERROR #.(SB-SYS:INT-SAP #X293FF470) #) 9: ("foreign function: call_into_lisp") 10: ("foreign function: funcall2") 11: ("foreign function: interrupt_internal_error") 12: ("foreign function: unblock_signals_in_context_and_maybe_warn") 13: ("no debug information for frame") 14: (HUNCHENTOOT-CGI::HANDLE-CGI-SCRIPT #P"/nay.py" #) 15: ((SB-PCL::FAST-METHOD HUNCHENTOOT:HANDLE-REQUEST (HUNCHENTOOT:ACCEPTOR HUNCHENTOOT:REQUEST)) # # # #) 16: ((SB-PCL::FAST-METHOD HUNCHENTOOT:PROCESS-REQUEST (T)) # # #) 17: (HUNCHENTOOT::DO-WITH-ACCEPTOR-REQUEST-COUNT-INCREMENTED # #) 18: ((SB-PCL::FAST-METHOD HUNCHENTOOT:PROCESS-CONNECTION (HUNCHENTOOT:ACCEPTOR T)) # # # #) 19: ((SB-PCL::FAST-METHOD HUNCHENTOOT:PROCESS-CONNECTION :AROUND (HUNCHENTOOT:ACCEPTOR T)) # #S(SB-PCL::FAST-METHOD-CALL :FUNCTION # :PV NIL :NEXT-METHOD-CALL NIL :ARG-INFO (2)) # #) 20: ((LAMBDA () :IN HUNCHENTOOT:CREATE-REQUEST-HANDLER-THREAD)) 21: ((LAMBDA () :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS)) 22: ((FLET #:WITHOUT-INTERRUPTS-BODY-227081 :IN SB-THREAD:MAKE-THREAD)) 23: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD:MAKE-THREAD)) 24: ((FLET #:WITHOUT-INTERRUPTS-BODY-88760 :IN SB-THREAD::CALL-WITH-MUTEX)) 25: (SB-THREAD::CALL-WITH-MUTEX # #> # T) 26: (SB-THREAD::INITIAL-THREAD-FUNCTION) 27: ("foreign function: call_into_lisp") 28: ("foreign function: funcall0") 29: ("foreign function: new_thread_trampoline") 30: ("foreign function: pthread_getprio") Hunchentoot 1.2.2 running on SBCL 1.0.54 Any suggestion is appreciated! From tyler.smith at mail.mcgill.ca Fri Dec 23 02:01:54 2011 From: tyler.smith at mail.mcgill.ca (Tyler Smith) Date: Thu, 22 Dec 2011 21:01:54 -0500 Subject: [hunchentoot-devel] easy-handler outputs to REPL instead of client In-Reply-To: <24701_1324597520_4EF3C110_24701_34_1_cad6e7588c4a400c995cb71f39632330@EXHUB2010-1.campus.MCGILL.CA> References: <24701_1324597520_4EF3C110_24701_34_1_cad6e7588c4a400c995cb71f39632330@EXHUB2010-1.campus.MCGILL.CA> Message-ID: On Thu, Dec 22, 2011 at 6:18 PM, Jens Teich wrote: >> (define-easy-handler (tyler :uri "/tyler") () >> ? ?(multiple-value-bind (records fields) >> ? ? ? ?(select [genus] [species] :from "specimens") >> ? ? ?(loop for rec in records do >> ? ? ? ? ? (loop for label in fields >> ? ? ? ? ? ? ?for val in rec do >> ? ? ? ? ? ? ? ?(with-html-output (*standard-output*) >> ? ? ? ? ? ? ? ? ?(:dt :class label (str label)) >> ? ? ? ? ? ? ? ? ?(:dd :class label (str val))))))) > > use with-html-output-to-string > with-html-output-to-string produces no output, either to the REPL or to the browser. Entering just the (M-V-B ...) expression (i.e., removing the define-easy-handler form) at the REPL also produces no output using W-H-O-to-string. Cheers, Tyler From hans.huebner at gmail.com Fri Dec 23 06:36:40 2011 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Fri, 23 Dec 2011 07:36:40 +0100 Subject: [hunchentoot-devel] Does hunchentoot-cgi still work with the new hunchentoot ? In-Reply-To: References: <4EF3BAD5.2020104@jensteich.de> Message-ID: On Fri, Dec 23, 2011 at 12:31 AM, z_axis wrote: > I want to use hunchentoot to host a python CGI application. ?By searching, i > found hunchentoot-cgi which exports a function called > "create-cgi-dispatcher-and-handler". [...] > Any suggestion is appreciated! I think hunchentoot-cgi has not properly been ported to the current Hunchentoot version. You could try contacting the author to see whether he's got something in the cooking, or use an older (1.1) version of Hunchentoot. Cheers, Hans From edi at agharta.de Fri Dec 23 08:05:02 2011 From: edi at agharta.de (Edi Weitz) Date: Fri, 23 Dec 2011 09:05:02 +0100 Subject: [hunchentoot-devel] easy-handler outputs to REPL instead of client In-Reply-To: References: Message-ID: Your loop doesn't return anything, does it? On Thu, Dec 22, 2011 at 11:51 PM, Tyler Smith wrote: > Hi, > > I'm trying to set up a simple sql-based website using cl-who, cl-sql > and hunchentoot. I've got the basic cl-sql and cl-who parts working, > but I'm having a trouble serving the pages with hunchentoot. > > The following works as expected: > > (ql:quickload :hunchentoot) > (use-package :hunchentoot) > > (setf my-acceptor (start (make-instance 'hunchentoot:easy-acceptor :port 4242))) > > (define-easy-handler (tyler :uri "/tyler") () > ?(with-html-output (*standard-output*) > ? ?(:ul (:li "hi there again")))) > > > After this, if I open localhost:4242/tyler in a browser I see my > unordered list. However, with this: > > (define-easy-handler (tyler :uri "/tyler") () > ?(multiple-value-bind (records fields) > ? ? ?(select [genus] [species] :from "specimens") > ? ?(loop for rec in records do > ? ? ? ? (loop for label in fields > ? ? ? ? ? ?for val in rec do > ? ? ? ? ? ? ?(with-html-output (*standard-output*) > ? ? ? ? ? ? ? ?(:dt :class label (str label)) > ? ? ? ? ? ? ? ?(:dd :class label (str val))))))) > > When I browse to localhost:4242/tyler nothing appears in the browser, > instead the html is printed in the REPL. If I evaluate just the (M-V-B > ...) form without the enclosing (D-E-H ...) it outputs the html to the > REPL as I expect. > > I have been following the examples in the hunchentoot docs, but I'm > stumped as to why this doesn't work. What have I missed? > > Thanks, > > Tyler > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel > From tyler.smith at mail.mcgill.ca Fri Dec 23 16:46:25 2011 From: tyler.smith at mail.mcgill.ca (Tyler Smith) Date: Fri, 23 Dec 2011 11:46:25 -0500 Subject: [hunchentoot-devel] easy-handler outputs to REPL instead of client In-Reply-To: <7828_1324627601_4EF43691_7828_378_1_6492ac1d41b049a38eee715a59fcb1b3@EXHUB2010-2.campus.MCGILL.CA> References: <7828_1324627601_4EF43691_7828_378_1_6492ac1d41b049a38eee715a59fcb1b3@EXHUB2010-2.campus.MCGILL.CA> Message-ID: Thank you! I didn't realize that with-html-output was returning a string, I thought it was emitting the html to the output as a side effect. In retrospect, that's silly. The following works, although it looks a little unwieldy. Any suggestions for improvement are welcome. Otherwise, thanks for your help and for all your code. Cheers, Tyler (define-easy-handler (tyler :uri "/tyler") () (multiple-value-bind (records fields) (select [genus] [species] :from "specimens") (loop for rec in records collect (loop for label in fields for val in rec collect (with-html-output-to-string (*standard-output*) (:dt :class label (str label)) (:dd :class label (str val))) into inner-output finally (return (format nil "~{~a~&~}" inner-output))) into outer-output finally (return (format nil "~{~a~&~}" outer-output))))) On Fri, Dec 23, 2011 at 3:05 AM, Edi Weitz wrote: > Your loop doesn't return anything, does it? > > On Thu, Dec 22, 2011 at 11:51 PM, Tyler Smith > wrote: >> Hi, >> >> I'm trying to set up a simple sql-based website using cl-who, cl-sql >> and hunchentoot. I've got the basic cl-sql and cl-who parts working, >> but I'm having a trouble serving the pages with hunchentoot. >> >> The following works as expected: >> >> (ql:quickload :hunchentoot) >> (use-package :hunchentoot) >> >> (setf my-acceptor (start (make-instance 'hunchentoot:easy-acceptor :port 4242))) >> >> (define-easy-handler (tyler :uri "/tyler") () >> ?(with-html-output (*standard-output*) >> ? ?(:ul (:li "hi there again")))) >> >> >> After this, if I open localhost:4242/tyler in a browser I see my >> unordered list. However, with this: >> >> (define-easy-handler (tyler :uri "/tyler") () >> ?(multiple-value-bind (records fields) >> ? ? ?(select [genus] [species] :from "specimens") >> ? ?(loop for rec in records do >> ? ? ? ? (loop for label in fields >> ? ? ? ? ? ?for val in rec do >> ? ? ? ? ? ? ?(with-html-output (*standard-output*) >> ? ? ? ? ? ? ? ?(:dt :class label (str label)) >> ? ? ? ? ? ? ? ?(:dd :class label (str val))))))) >> >> When I browse to localhost:4242/tyler nothing appears in the browser, >> instead the html is printed in the REPL. If I evaluate just the (M-V-B >> ...) form without the enclosing (D-E-H ...) it outputs the html to the >> REPL as I expect. >> >> I have been following the examples in the hunchentoot docs, but I'm >> stumped as to why this doesn't work. What have I missed? >> >> Thanks, >> >> Tyler >> >> _______________________________________________ >> tbnl-devel site list >> tbnl-devel at common-lisp.net >> http://common-lisp.net/mailman/listinfo/tbnl-devel >> > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel From hans.huebner at gmail.com Fri Dec 23 17:57:21 2011 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Fri, 23 Dec 2011 18:57:21 +0100 Subject: [hunchentoot-devel] easy-handler outputs to REPL instead of client In-Reply-To: References: <7828_1324627601_4EF43691_7828_378_1_6492ac1d41b049a38eee715a59fcb1b3@EXHUB2010-2.campus.MCGILL.CA> Message-ID: Here is some food for thought: (with-output-to-string (s) (cl-who:with-html-output (s) (dotimes (i 10) (cl-who:htm (:p "hello"))))) -Hans On Fri, Dec 23, 2011 at 5:46 PM, Tyler Smith wrote: > Thank you! > > I didn't realize that with-html-output was returning a string, I > thought it was emitting the html to the output as a side effect. In > retrospect, that's silly. > > The following works, although it looks a little unwieldy. Any > suggestions for improvement are welcome. Otherwise, thanks for your > help and for all your code. > > Cheers, > > Tyler > > > (define-easy-handler (tyler :uri "/tyler") () > ?(multiple-value-bind (records fields) > ? ? ?(select [genus] [species] :from "specimens") > ? ?(loop for rec in records > ? ? ? collect > ? ? ? ? (loop > ? ? ? ? ? ?for label in fields > ? ? ? ? ? ?for val in rec > ? ? ? ? ? ?collect (with-html-output-to-string (*standard-output*) > ? ? ? ? ? ? ? ? ? ? ?(:dt :class label (str label)) > ? ? ? ? ? ? ? ? ? ? ?(:dd :class label (str val))) > ? ? ? ? ? ?into inner-output > ? ? ? ? ? ?finally (return (format nil "~{~a~&~}" inner-output))) > ? ? ? into outer-output > ? ? ? finally (return (format nil "~{~a~&~}" outer-output))))) > > > On Fri, Dec 23, 2011 at 3:05 AM, Edi Weitz wrote: >> Your loop doesn't return anything, does it? >> >> On Thu, Dec 22, 2011 at 11:51 PM, Tyler Smith >> wrote: >>> Hi, >>> >>> I'm trying to set up a simple sql-based website using cl-who, cl-sql >>> and hunchentoot. I've got the basic cl-sql and cl-who parts working, >>> but I'm having a trouble serving the pages with hunchentoot. >>> >>> The following works as expected: >>> >>> (ql:quickload :hunchentoot) >>> (use-package :hunchentoot) >>> >>> (setf my-acceptor (start (make-instance 'hunchentoot:easy-acceptor :port 4242))) >>> >>> (define-easy-handler (tyler :uri "/tyler") () >>> ?(with-html-output (*standard-output*) >>> ? ?(:ul (:li "hi there again")))) >>> >>> >>> After this, if I open localhost:4242/tyler in a browser I see my >>> unordered list. However, with this: >>> >>> (define-easy-handler (tyler :uri "/tyler") () >>> ?(multiple-value-bind (records fields) >>> ? ? ?(select [genus] [species] :from "specimens") >>> ? ?(loop for rec in records do >>> ? ? ? ? (loop for label in fields >>> ? ? ? ? ? ?for val in rec do >>> ? ? ? ? ? ? ?(with-html-output (*standard-output*) >>> ? ? ? ? ? ? ? ?(:dt :class label (str label)) >>> ? ? ? ? ? ? ? ?(:dd :class label (str val))))))) >>> >>> When I browse to localhost:4242/tyler nothing appears in the browser, >>> instead the html is printed in the REPL. If I evaluate just the (M-V-B >>> ...) form without the enclosing (D-E-H ...) it outputs the html to the >>> REPL as I expect. >>> >>> I have been following the examples in the hunchentoot docs, but I'm >>> stumped as to why this doesn't work. What have I missed? >>> >>> Thanks, >>> >>> Tyler >>> >>> _______________________________________________ >>> tbnl-devel site list >>> tbnl-devel at common-lisp.net >>> http://common-lisp.net/mailman/listinfo/tbnl-devel >>> >> >> _______________________________________________ >> tbnl-devel site list >> tbnl-devel at common-lisp.net >> http://common-lisp.net/mailman/listinfo/tbnl-devel > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel