From lispercat at gmail.com Tue Feb 6 17:18:00 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Tue, 6 Feb 2007 12:18:00 -0500 Subject: [hunchentoot-devel] Trying to display test page Message-ID: I've installed the hunchentoot server, put in my Lisp lines: (asdf:oos 'asdf:load-op :hunchentoot-test) (hunchentoot:start-server :port 3001) Now I am trying to figure out how can I display the test page (if I don't have a direct connection to my local server and the port 3001). If I try to use url like http://www.mydomain.com/lisp/hunchentoot/ test I see the default page of Hunchentoot (with message "You're most likely seeing it because the server administrator hasn't set up a custom default page yet"). Any ideas how can I reach the test page? Thank you, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From erick at fsl.org.mx Tue Feb 6 19:10:07 2007 From: erick at fsl.org.mx (Erick Lopez Carreon) Date: Tue, 06 Feb 2007 13:10:07 -0600 Subject: [hunchentoot-devel] Trying to display test page In-Reply-To: References: Message-ID: <1170789008.3686.36.camel@ikki> On Tue, 2007-02-06 at 12:18 -0500, Andrei Stebakov wrote: > I've installed the hunchentoot server, put in my Lisp lines: > > > (asdf:oos 'asdf:load-op :hunchentoot-test) > (hunchentoot:start-server :port 3001) > > > Now I am trying to figure out how can I display the test page (if I > don't have a direct connection to my local server and the port 3001). > If I try to use url like http://www.mydomain.com/lisp/hunchentoot/ > test > I see the default page of Hunchentoot (with message "You're most > likely seeing it because the server administrator hasn't set up a > custom default page yet"). > Any ideas how can I reach the test page? > Hello Andrei: first part: I assume you already are using the "Hunchentoot behind a proxy" configuration. If you follow the instructions on Hunchentoot page with mod_proxy you should have something like this: ProxyPass /lisp http://127.0.0.1:3001/lisp ProxyPassReverse /lisp http://127.0.0.1:3001/lisp So you can access the test page with : http://www.mydomain.com/lisp/hunchentoot/test If you want access the test page using only http://www.mydomain.com/lisp/hunchentoot/ Maybe you need use a redirect line in Apache config, or "maybe" modify the *default-handler*/default-dispatcher code. Second part: I do some configuration tests and if i use : ProxyPass /lisp http://127.0.0.1:3001/lisp ProxyPassReverse /lisp http://127.0.0.1:3001/lisp I have exactly the same problem you describe, the problem seems to be the http://127.0.0.1:3001/lisp parts, try yourself some variations and you see. The way i got it works well is this: ProxyPass /hunchentoot http://127.0.0.1:3001/hunchentoot ProxyPassReverse /hunchentoot http://127.0.0.1:3001/hunchentoot An then this url ,and the links on it, work: http://mydomain.test/hunchentoot/test Hope this helps, and i need to learn more about the proxyPass directives :) Best Regards! -- Erick Ivaan Lopez Carreon -- erick at fsl.org.mx PGP Key 1024D/9741C03A 2004-11-19 Key fingerprint = 1764 3C6F B433 B2DD 9029 98B1 8E6B 58D3 9741 C03A Participa en la FUNDACION DE SOFTWARE LIBRE, A.C. http://www.fsl.org.mx Somos una asociaci?n civil dedicada a promover, difundir y apoyar el uso y desarrollo del Software Libre en M?xico. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From lispercat at gmail.com Tue Feb 6 19:33:44 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Tue, 6 Feb 2007 14:33:44 -0500 Subject: [hunchentoot-devel] Trying to display test page In-Reply-To: <1170789008.3686.36.camel@ikki> References: <1170789008.3686.36.camel@ikki> Message-ID: Thank you, Erick! I got it. Looks like domain.com/lisp puzzles it as it looks for hunchenback/test right after the domain name. I added ProxyPass /lisp http://127.0.0.1:3001/lisp ProxyPassReverse /lisp http://127.0.0.1:3001/lisp ProxyPass /hunchentoot http://127.0.0.1:3001/hunchentoot ProxyPassReverse /hunchentoot http://127.0.0.1:3001/hunchentoot Into my http.conf and now I've got both lisp handler and hunchenback test! Regards, Andrew On 2/6/07, Erick Lopez Carreon wrote: > > On Tue, 2007-02-06 at 12:18 -0500, Andrei Stebakov wrote: > > I've installed the hunchentoot server, put in my Lisp lines: > > > > > > (asdf:oos 'asdf:load-op :hunchentoot-test) > > (hunchentoot:start-server :port 3001) > > > > > > Now I am trying to figure out how can I display the test page (if I > > don't have a direct connection to my local server and the port 3001). > > If I try to use url like http://www.mydomain.com/lisp/hunchentoot/ > > test > > I see the default page of Hunchentoot (with message "You're most > > likely seeing it because the server administrator hasn't set up a > > custom default page yet"). > > Any ideas how can I reach the test page? > > > > Hello Andrei: > > first part: > > I assume you already are using the "Hunchentoot behind a proxy" > configuration. > > If you follow the instructions on Hunchentoot page with mod_proxy you > should have something like this: > > ProxyPass /lisp http://127.0.0.1:3001/lisp > ProxyPassReverse /lisp http://127.0.0.1:3001/lisp > > So you can access the test page with : > http://www.mydomain.com/lisp/hunchentoot/test > > If you want access the test page using only > http://www.mydomain.com/lisp/hunchentoot/ > > Maybe you need use a redirect line in Apache config, or "maybe" modify the > *default-handler*/default-dispatcher code. > > > Second part: > > I do some configuration tests and if i use : > > ProxyPass /lisp http://127.0.0.1:3001/lisp > ProxyPassReverse /lisp http://127.0.0.1:3001/lisp > > I have exactly the same problem you describe, the problem seems to be the > http://127.0.0.1:3001/lisp parts, try yourself some variations and you > see. > > The way i got it works well is this: > > ProxyPass /hunchentoot http://127.0.0.1:3001/hunchentoot > ProxyPassReverse /hunchentoot http://127.0.0.1:3001/hunchentoot > > An then this url ,and the links on it, work: > http://mydomain.test/hunchentoot/test > > > Hope this helps, and i need to learn more about the proxyPass directives > :) > > Best Regards! > > > -- > Erick Ivaan Lopez Carreon -- erick at fsl.org.mx > PGP Key 1024D/9741C03A 2004-11-19 > Key fingerprint = 1764 3C6F B433 B2DD 9029 98B1 8E6B 58D3 9741 C03A > > > Participa en la FUNDACION DE SOFTWARE LIBRE, A.C. > > http://www.fsl.org.mx > > Somos una asociaci?n civil dedicada a promover, difundir y apoyar el uso > y desarrollo del Software Libre en M?xico. > > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lispercat at gmail.com Tue Feb 6 19:35:17 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Tue, 6 Feb 2007 14:35:17 -0500 Subject: [hunchentoot-devel] Trying to display test page In-Reply-To: References: <1170789008.3686.36.camel@ikki> Message-ID: Haha, I misspelled hunchentoot as hunchenback, sorry :) Andrew On 2/6/07, Andrei Stebakov wrote: > > Thank you, Erick! I got it. Looks like domain.com/lisp puzzles it as it > looks for hunchenback/test right after the domain name. > I added > ProxyPass /lisp http://127.0.0.1:3001/lisp > ProxyPassReverse /lisp http://127.0.0.1:3001/lisp > > ProxyPass /hunchentoot http://127.0.0.1:3001/hunchentoot > ProxyPassReverse /hunchentoot http://127.0.0.1:3001/hunchentoot > > Into my http.conf and now I've got both lisp handler and hunchenback test! > > Regards, > Andrew > > On 2/6/07, Erick Lopez Carreon wrote: > > > On Tue, 2007-02-06 at 12:18 -0500, Andrei Stebakov wrote: > > > I've installed the hunchentoot server, put in my Lisp lines: > > > > > > > > > (asdf:oos 'asdf:load-op :hunchentoot-test) > > > (hunchentoot:start-server :port 3001) > > > > > > > > > Now I am trying to figure out how can I display the test page (if I > > > don't have a direct connection to my local server and the port 3001). > > > If I try to use url like http://www.mydomain.com/lisp/hunchentoot/ > > > test > > > I see the default page of Hunchentoot (with message "You're most > > > likely seeing it because the server administrator hasn't set up a > > > custom default page yet"). > > > Any ideas how can I reach the test page? > > > > > > > Hello Andrei: > > > > first part: > > > > I assume you already are using the "Hunchentoot behind a proxy" > > configuration. > > > > If you follow the instructions on Hunchentoot page with mod_proxy you > > should have something like this: > > > > ProxyPass /lisp http://127.0.0.1:3001/lisp > > ProxyPassReverse /lisp http://127.0.0.1:3001/lisp > > > > So you can access the test page with : > > http://www.mydomain.com/lisp/hunchentoot/test > > > > If you want access the test page using only > > http://www.mydomain.com/lisp/hunchentoot/ > > > > Maybe you need use a redirect line in Apache config, or "maybe" modify > > the > > *default-handler*/default-dispatcher code. > > > > > > Second part: > > > > I do some configuration tests and if i use : > > > > ProxyPass /lisp http://127.0.0.1:3001/lisp > > ProxyPassReverse /lisp http://127.0.0.1:3001/lisp > > > > I have exactly the same problem you describe, the problem seems to be > > the > > http://127.0.0.1:3001/lisp parts, try yourself some variations and you > > see. > > > > The way i got it works well is this: > > > > ProxyPass /hunchentoot http://127.0.0.1:3001/hunchentoot > > ProxyPassReverse /hunchentoot http://127.0.0.1:3001/hunchentoot > > > > An then this url ,and the links on it, work: > > http://mydomain.test/hunchentoot/test > > > > > > Hope this helps, and i need to learn more about the proxyPass directives > > :) > > > > Best Regards! > > > > > > -- > > Erick Ivaan Lopez Carreon -- erick at fsl.org.mx > > PGP Key 1024D/9741C03A 2004-11-19 > > Key fingerprint = 1764 3C6F B433 B2DD 9029 98B1 8E6B 58D3 9741 C03A > > > > > > Participa en la FUNDACION DE SOFTWARE LIBRE, A.C. > > > > http://www.fsl.org.mx > > > > Somos una asociaci?n civil dedicada a promover, difundir y apoyar el uso > > y desarrollo del Software Libre en M?xico. > > > > > > _______________________________________________ > > tbnl-devel site list > > tbnl-devel at common-lisp.net > > http://common-lisp.net/mailman/listinfo/tbnl-devel > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Tue Feb 6 20:02:43 2007 From: edi at agharta.de (Edi Weitz) Date: Tue, 06 Feb 2007 21:02:43 +0100 Subject: [hunchentoot-devel] Trying to display test page In-Reply-To: <1170789008.3686.36.camel@ikki> (Erick Lopez Carreon's message of "Tue, 06 Feb 2007 13:10:07 -0600") References: <1170789008.3686.36.camel@ikki> Message-ID: On Tue, 06 Feb 2007 13:10:07 -0600, Erick Lopez Carreon wrote: > I do some configuration tests and if i use : > > ProxyPass /lisp http://127.0.0.1:3001/lisp > ProxyPassReverse /lisp http://127.0.0.1:3001/lisp > > I have exactly the same problem you describe, the problem seems to be the > http://127.0.0.1:3001/lisp parts, try yourself some variations and you see. > > The way i got it works well is this: > > ProxyPass /hunchentoot http://127.0.0.1:3001/hunchentoot > ProxyPassReverse /hunchentoot http://127.0.0.1:3001/hunchentoot Yes, the example is not quite clear and should use /hunchentoot instead of /lisp. I'll change that. Cheers, Edi. From lispercat at gmail.com Tue Feb 6 21:43:51 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Tue, 6 Feb 2007 16:43:51 -0500 Subject: [hunchentoot-devel] Trying to display test page In-Reply-To: References: <1170789008.3686.36.camel@ikki> Message-ID: Actually, jusp putting in http.conf: ProxyPass /lisp http://127.0.0.1:3001 ProxyPassReverse /lisp http://127.0.0.1:3001 fixes the problem, so now I can refer to the test as www.domain.com/lisp/hunchentoot/test which first redirects it to 127.0.0.3001 and then uses "hunchentoot/test" as a function id. Thank you, guys! Andrew On 2/6/07, Edi Weitz wrote: > > On Tue, 06 Feb 2007 13:10:07 -0600, Erick Lopez Carreon > wrote: > > > I do some configuration tests and if i use : > > > > ProxyPass /lisp http://127.0.0.1:3001/lisp > > ProxyPassReverse /lisp http://127.0.0.1:3001/lisp > > > > I have exactly the same problem you describe, the problem seems to be > the > > http://127.0.0.1:3001/lisp parts, try yourself some variations and you > see. > > > > The way i got it works well is this: > > > > ProxyPass /hunchentoot http://127.0.0.1:3001/hunchentoot > > ProxyPassReverse /hunchentoot http://127.0.0.1:3001/hunchentoot > > Yes, the example is not quite clear and should use /hunchentoot > instead of /lisp. I'll change that. > > Cheers, > Edi. > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lispercat at gmail.com Tue Feb 6 21:47:13 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Tue, 6 Feb 2007 16:47:13 -0500 Subject: [hunchentoot-devel] Trying to display test page In-Reply-To: References: <1170789008.3686.36.camel@ikki> Message-ID: Oops, this just shows the first page of the test web (the menu). As I go to any other link it get a "Not found" message. Looks like there shouldn't be any "lisp" in the url after all. Andrew On 2/6/07, Andrei Stebakov wrote: > > Actually, jusp putting in http.conf: > > ProxyPass /lisp http://127.0.0.1:3001 > ProxyPassReverse /lisp http://127.0.0.1:3001 > > fixes the problem, so now I can refer to the test as > www.domain.com/lisp/hunchentoot/test which first redirects it to > 127.0.0.3001 and then uses "hunchentoot/test" as a function id. > > Thank you, guys! > > Andrew > > > On 2/6/07, Edi Weitz wrote: > > > > On Tue, 06 Feb 2007 13:10:07 -0600, Erick Lopez Carreon > > wrote: > > > > > I do some configuration tests and if i use : > > > > > > ProxyPass /lisp http://127.0.0.1:3001/lisp > > > ProxyPassReverse /lisp http://127.0.0.1:3001/lisp > > > > > > I have exactly the same problem you describe, the problem seems to be > > the > > > http://127.0.0.1:3001/lisp parts, try yourself some variations and you > > see. > > > > > > The way i got it works well is this: > > > > > > ProxyPass /hunchentoot http://127.0.0.1:3001/hunchentoot > > > ProxyPassReverse /hunchentoot http://127.0.0.1:3001/hunchentoot > > > > Yes, the example is not quite clear and should use /hunchentoot > > instead of /lisp. I'll change that. > > > > Cheers, > > Edi. > > _______________________________________________ > > tbnl-devel site list > > tbnl-devel at common-lisp.net > > http://common-lisp.net/mailman/listinfo/tbnl-devel > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Thu Feb 8 07:35:15 2007 From: edi at agharta.de (Edi Weitz) Date: Thu, 08 Feb 2007 08:35:15 +0100 Subject: [hunchentoot-devel] Re: Hunchentoot - cookie-in v/s cookie-out In-Reply-To: <794f042d0702072149l6002d66eqfcd53022dc90651b@mail.gmail.com> (Saurabh Nanda's message of "Thu, 8 Feb 2007 11:19:18 +0530") References: <794f042d0702072149l6002d66eqfcd53022dc90651b@mail.gmail.com> Message-ID: H,, On Thu, 8 Feb 2007 11:19:18 +0530, "Saurabh Nanda" wrote: [Please use the mailing list. See Cc.] > One small question, why the difference between behaviours of > cookie-in and cookie-out functions? The former returns the value > whereas the latter returns a cookie object. The server sends a full "Set-Cookie" header with (potentially) "expires", "path", "domain", and "secure" attributes, while the client only sends a "Cookie" header with names and values. http://wp.netscape.com/newsref/std/cookie_spec.html I don't think it would make sense to wrap these incoming cookies into full-blown cookie objects. > Further, to get the cookie value from the cookie object one has to > use (slot-value cookie-object 'hunchentoot::value) as the "value" > symbol is not external. There's an exported accessor COOKIE-VALUE, see the documentation: http://weitz.de/hunchentoot/#cookie-value Cheers, Edi. From lispercat at gmail.com Thu Feb 8 15:40:38 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Thu, 8 Feb 2007 10:40:38 -0500 Subject: [hunchentoot-devel] Printing the output Message-ID: I am a bit confused about using macros like with-html. Let's say if I want to produce an html with my post parameter value in it. Just saying (:p (post-parameter "foo")) won't put the value in the

tag. On the other hand saying (:p (format t "~a" (post-parameter "foo"))) or (:p (esc (post-parameter "foo"))) will produce the expected result. Same goes with (:p (esc (with-output-to-string (s) (format s "~a" (post-parameter "foo"))))) My question is what's common about the latter examples that makes a printing possible? Does it mean that all printing within with-html should happen to *standard-output* and the esc function redirects it to it? What package should I look at to have a better understanding of it? Thank you! Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffrey at cunningham.net Thu Feb 8 16:19:35 2007 From: jeffrey at cunningham.net (Jeffrey Cunningham) Date: Thu, 8 Feb 2007 08:19:35 -0800 Subject: [hunchentoot-devel] Printing the output In-Reply-To: References: Message-ID: <20070208161935.GA5033@achilles.olympus.net> On Thu Feb 08, 2007 at 10:40:38AM -0500, Andrei Stebakov wrote: > I am a bit confused about using macros like with-html. Let's say if I want to > produce an html with my post parameter value in it. Just saying (:p > (post-parameter "foo")) won't put the value in the

tag. > On the other hand saying (:p (format t "~a" (post-parameter "foo"))) or (:p > (esc (post-parameter "foo"))) will produce the expected result. Same goes with > (:p > (esc (with-output-to-string (s) > (format s "~a" (post-parameter "foo"))))) > Try this: (with-html (:p (str (post-parameter "foo")))) --Jeff From edi at agharta.de Thu Feb 8 16:28:36 2007 From: edi at agharta.de (Edi Weitz) Date: Thu, 08 Feb 2007 17:28:36 +0100 Subject: [hunchentoot-devel] Printing the output In-Reply-To: (Andrei Stebakov's message of "Thu, 8 Feb 2007 10:40:38 -0500") References: Message-ID: On Thu, 8 Feb 2007 10:40:38 -0500, "Andrei Stebakov" wrote: [This should really go to cl-who-devel, see Cc.] > I am a bit confused about using macros like with-html. Let's say if > I want to produce an html with my post parameter value in it. Just > saying (:p (post-parameter "foo")) won't put the value in the

> tag. See STR or ESC: http://weitz.de/cl-who/#syntax > On the other hand saying (:p (format t "~a" (post-parameter "foo"))) > or (:p (esc (post-parameter "foo"))) will produce the expected > result. Same goes with > (:p > (esc (with-output-to-string (s) > (format s "~a" (post-parameter "foo"))))) The first form works only by accident, the second form is OK, the third one is a bit overdone. > My question is what's common about the latter examples that makes a > printing possible? Does it mean that all printing within with-html > should happen to *standard-output* and the esc function redirects it > to it? Look at the first parameter of WITH-HTML-OUTPUT[-TO-STRING]. > What package should I look at to have a better understanding of it? Package? What do packages have to do with your question? http://www.lispworks.com/documentation/HyperSpec/Body/11_.htm Have you read the documentation? http://weitz.de/cl-who/ Cheers, Edi. From lispercat at gmail.com Thu Feb 8 22:45:01 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Thu, 8 Feb 2007 17:45:01 -0500 Subject: [hunchentoot-devel] Displaying an image in the text content Message-ID: Going trough the test server code it's clear how to diplay an image based on a static handler or sending a raw image stream to the client. But how can show an image in context of a normal html page (surrounded by other text tags like

etc)? Thank you, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Thu Feb 8 22:45:26 2007 From: edi at agharta.de (Edi Weitz) Date: Thu, 08 Feb 2007 23:45:26 +0100 Subject: [hunchentoot-devel] Ajax library for Hunchentoot Message-ID: Ury Marshak has written an Ajax framework for Hunchentoot which you can find here: http://www.cliki.net/HT-AJAX http://85.65.214.241/misc/ht-ajax.html I haven't found the time yet to try it out, but it looks nice. Cheers, Edi. From xach at xach.com Thu Feb 8 22:47:59 2007 From: xach at xach.com (Zach Beane) Date: Thu, 8 Feb 2007 17:47:59 -0500 Subject: [hunchentoot-devel] Displaying an image in the text content In-Reply-To: References: Message-ID: <20070208224759.GA2495@xach.com> On Thu, Feb 08, 2007 at 05:45:01PM -0500, Andrei Stebakov wrote: > Going trough the test server code it's clear how to diplay an image based on > a static handler or sending a raw image stream to the client. But how can > show an image in context of a normal html page (surrounded by other text > tags like
etc)? Add a handler for /path/to/image.jpg, and put in the HTML? Zach From lispercat at gmail.com Thu Feb 8 23:13:16 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Thu, 8 Feb 2007 18:13:16 -0500 Subject: [hunchentoot-devel] Displaying an image in the text content In-Reply-To: <20070208224759.GA2495@xach.com> References: <20070208224759.GA2495@xach.com> Message-ID: Thank you, it works. Only the /path/to/image.jpg should always start with a path to your lisp server (like "/hunchentoot/test") otherwise the handler won't work. So, does it mean that if you have a number of images that you want to display you need to create-static-file-dispatcher-and-handler for each of them? Thank you, Andrew On 2/8/07, Zach Beane wrote: > > On Thu, Feb 08, 2007 at 05:45:01PM -0500, Andrei Stebakov wrote: > > Going trough the test server code it's clear how to diplay an image > based on > > a static handler or sending a raw image stream to the client. But how > can > > show an image in context of a normal html page (surrounded by other text > > tags like
etc)? > > Add a handler for /path/to/image.jpg, and put src="/path/to/image.jpg"> in the HTML? > > Zach > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lispercat at gmail.com Thu Feb 8 23:20:09 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Thu, 8 Feb 2007 18:20:09 -0500 Subject: [hunchentoot-devel] Displaying an image in the text content In-Reply-To: References: <20070208224759.GA2495@xach.com> Message-ID: Oh, for a multiple number of images I can use create-folder-dispatcher-and-handler! Looks really neat! Thank you, Andrew On 2/8/07, Andrei Stebakov wrote: > > Thank you, it works. Only the /path/to/image.jpg should always start with > a path to your lisp server (like "/hunchentoot/test") otherwise the handler > won't work. So, does it mean that if you have a number of images that you > want to display you need to create-static-file-dispatcher-and-handler for > each of them? > > Thank you, > Andrew > > On 2/8/07, Zach Beane wrote: > > > > On Thu, Feb 08, 2007 at 05:45:01PM -0500, Andrei Stebakov wrote: > > > Going trough the test server code it's clear how to diplay an image > > based on > > > a static handler or sending a raw image stream to the client. But how > > can > > > show an image in context of a normal html page (surrounded by other > > text > > > tags like
etc)? > > > > Add a handler for /path/to/image.jpg, and put > src="/path/to/image.jpg"> in the HTML? > > > > Zach > > _______________________________________________ > > tbnl-devel site list > > tbnl-devel at common-lisp.net > > http://common-lisp.net/mailman/listinfo/tbnl-devel > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xach at xach.com Fri Feb 9 00:36:17 2007 From: xach at xach.com (Zach Beane) Date: Thu, 8 Feb 2007 19:36:17 -0500 Subject: [hunchentoot-devel] Displaying an image in the text content In-Reply-To: References: <20070208224759.GA2495@xach.com> Message-ID: <20070209003617.GC2495@xach.com> On Thu, Feb 08, 2007 at 06:13:16PM -0500, Andrei Stebakov wrote: > Thank you, it works. Only the /path/to/image.jpg should always start with a > path to your lisp server (like "/hunchentoot/test") otherwise the handler > won't work. So, does it mean that if you have a number of images that you > want to display you need to create-static-file-dispatcher-and-handler for > each of them? Personally, I have a separate webserver for static content such as images, css, and the like. For example, the hunchentoot site http://whatever.xach.com/ might have a corresponding server http://static.whatever.xach.com/ that has a traditional static-file webserver. The lisp server can write files into its document space, and then reference them by sending static.whatever.xach.com urls back to the client. Zach From lispercat at gmail.com Mon Feb 12 04:36:56 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Sun, 11 Feb 2007 23:36:56 -0500 Subject: [hunchentoot-devel] Library for http requests Message-ID: Hi I am wonderng if hunchentoot or some of Edi's tools have support for http get/post requests (when I need to request some information from hunchentoot to another server). I found trivial-http, but it depends on trivial-sockets which is dead and I couldn't download the latter lib. I thought that hunchentoot would be a good place to put in such a small but useful functionality. Maybe it's already there only I couldn't find the functions. Thank you, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From ctdean at sokitomi.com Mon Feb 12 05:05:10 2007 From: ctdean at sokitomi.com (Chris Dean) Date: Sun, 11 Feb 2007 21:05:10 -0800 Subject: [hunchentoot-devel] Library for http requests In-Reply-To: (Andrei Stebakov's message of "Sun, 11 Feb 2007 23:36:56 -0500") References: Message-ID: "Andrei Stebakov" writes: > I am wonderng if hunchentoot or some of Edi's tools have support for > http get/post requests (when I need to request some information from > hunchentoot to another server). Not sure exactlu what you mean, but if you're looking for an http client try Drakma -- http://weitz.de/drakma/ Cheers, Chris Dean From lispercat at gmail.com Mon Feb 12 20:24:04 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Mon, 12 Feb 2007 15:24:04 -0500 Subject: [hunchentoot-devel] Library for http requests In-Reply-To: References: Message-ID: Thanks, Chris This is exaclty what I need. The GET method works just fine, but I have trouble with the POST method uploading the files. Edi, here is a question (I am not sure if it's the right mailing list to ask it...) When I say (this is part of a function, so I use back-quote for parameters): (drakma:http-request "/some/uri" :method :post :form-data t :parameters `(("Name1" . ,name1) ("Name2" . ,name2) ("File" . ,file-name)))) I got an "unknown error" from the remote host. Looks like there is problem with streaming file contents. I did a little of debugging printing the content of file buffer (in send-content function) looks like the file is being open and read, but something happens at the receiving end. I wonder how can I debug it more. When I do the same request from the FORM in Firefox everything works. Thank you, Andrew On 2/12/07, Chris Dean wrote: > > > "Andrei Stebakov" writes: > > I am wonderng if hunchentoot or some of Edi's tools have support for > > http get/post requests (when I need to request some information from > > hunchentoot to another server). > > Not sure exactlu what you mean, but if you're looking for an http > client try Drakma -- http://weitz.de/drakma/ > > Cheers, > Chris Dean > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Mon Feb 12 20:33:11 2007 From: edi at agharta.de (Edi Weitz) Date: Mon, 12 Feb 2007 21:33:11 +0100 Subject: [hunchentoot-devel] Library for http requests In-Reply-To: (Andrei Stebakov's message of "Mon, 12 Feb 2007 15:24:04 -0500") References: Message-ID: On Mon, 12 Feb 2007 15:24:04 -0500, "Andrei Stebakov" wrote: > I am not sure if it's the right mailing list to ask it... It isn't. http://weitz.de/drakma/#mail From nowhere.man at levallois.eu.org Thu Feb 15 02:41:00 2007 From: nowhere.man at levallois.eu.org (Pierre THIERRY) Date: Thu, 15 Feb 2007 03:41:00 +0100 Subject: Mercurial repositories (was Re: [hunchentoot-devel] New release 0.5.1) In-Reply-To: <20070119003232.GC16524@bateleur.arcanes.fr.eu.org> References: <7EB05352-CA54-4431-9CE3-73AE8D913992@bobobeach.com> <20070119003232.GC16524@bateleur.arcanes.fr.eu.org> Message-ID: <20070215024100.GA7532@bateleur.arcanes.fr.eu.org> Scribit Pierre THIERRY dies 19/01/2007 hora 01:32: > By the way, I'll try to track the versions of some of Edi's packages, > and if someone is interested, I could make a Mercurial repository > publicly available. After fighting CVS and Apache proxying, I'm now at last setting up some public repositories of selected packages. Currently only chunga is available, but others will follow soon, all referenced at this URI: http://arcanes.fr.eu.org/~pierre/2007/02/weitz/ I will add flexi-streams, hunchentoot and tbnl at least. If some of you are interested in other packages, please tell me. I've set up Mercurial repositories because it's the tool I use everyday. If you would prefer using another VCS to study the history of the packages I'll make available, you should take a look at tailor: http://progetti.arstecnica.it/tailor/ If needed, I could probably provide a default configuration file with all available Mercurial repositories for common VCSes, like Darcs. Historically, Pierre -- nowhere.man at levallois.eu.org OpenPGP 0xD9D50D8A -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From edi at agharta.de Thu Feb 15 07:27:50 2007 From: edi at agharta.de (Edi Weitz) Date: Thu, 15 Feb 2007 08:27:50 +0100 Subject: [hunchentoot-devel] Re: Mercurial repositories In-Reply-To: <20070215024100.GA7532@bateleur.arcanes.fr.eu.org> (Pierre THIERRY's message of "Thu, 15 Feb 2007 03:41:00 +0100") References: <7EB05352-CA54-4431-9CE3-73AE8D913992@bobobeach.com> <20070119003232.GC16524@bateleur.arcanes.fr.eu.org> <20070215024100.GA7532@bateleur.arcanes.fr.eu.org> Message-ID: On Thu, 15 Feb 2007 03:41:00 +0100, Pierre THIERRY wrote: > After fighting CVS and Apache proxying, I'm now at last setting up > some public repositories of selected packages. Currently only chunga > is available, but others will follow soon, all referenced at this > URI: > > http://arcanes.fr.eu.org/~pierre/2007/02/weitz/ > > I will add flexi-streams, hunchentoot and tbnl at least. If some of > you are interested in other packages, please tell me. Thanks. I've added a link from the Chunga homepage. Let me know once you're done with the other libs, and I'll add links there as well. From emailmac at gmail.com Fri Feb 16 02:35:10 2007 From: emailmac at gmail.com (Mac Chan) Date: Thu, 15 Feb 2007 18:35:10 -0800 Subject: [hunchentoot-devel] folder-dispatcher directory listing Message-ID: <4877ae640702151835x60eeb866ycf0555c7393434bc@mail.gmail.com> Hi all, Lately I've been doing some plain html and javascript hacking on *.html and *.js file, and I found the apache directory listing to be quite handy (IE won't let you run scripts from file:/// so you must host it in a server and access with http://localhost/). I'm using mod_lisp w/ apache so this is not a problem for me but I intend to use hunchentoot alone when it stabilized. I've seen people asking for this before so here's a simple patch to enable directory listing for create-folder-dispatcher-and-handler. Originally I want to change the signature from create-folder-dispatcher-and-handler (uri-prefix base-path &optional content-type) to create-folder-dispatcher-and-handler (uri-prefix base-path &optional create-index-page-p content-type) but it makes it inconsistent with the other api. (and that I don't need to update the documentation :-) Anyway attached are the diffs so feel free to change it if you really don't want the index page enabled by default. Cheers, -- Mac (PS The code should look less horrible if cl-who is available but it's really a pain since I don't want to introduce dependencies to hunchentoot. There is one function copied directly from cl-fad for the same reason) -------------- next part -------------- ==== hunchentoot/misc.lisp#1 - hunchentoot/misc.lisp ==== *************** *** 137,144 **** denoted by PATH. Send a content type header corresponding to CONTENT-TYPE or \(if that is NIL) tries to determine the content type via the file's suffix." ! (unless (or (pathname-name path) ! (pathname-type path)) ;; not a file (setf (return-code) +http-bad-request+) (throw 'handler-done nil)) --- 137,145 ---- denoted by PATH. Send a content type header corresponding to CONTENT-TYPE or \(if that is NIL) tries to determine the content type via the file's suffix." ! (unless (and path ! (or (pathname-name path) ! (pathname-type path))) ;; not a file (setf (return-code) +http-bad-request+) (throw 'handler-done nil)) *************** *** 177,182 **** --- 178,315 ---- (lambda () (handle-static-file path content-type))))) + ;; should pull in cl-fad for one function? + (defun directory-pathname-p (pathspec) + "Returns NIL if PATHSPEC \(a pathname designator) does not designate + a directory, PATHSPEC otherwise. It is irrelevant whether file or + directory designated by PATHSPEC does actually exist." + (flet ((component-present-p (value) + (and value (not (eql value :unspecific))))) + (and + (not (component-present-p (pathname-name pathspec))) + (not (component-present-p (pathname-type pathspec))) + pathspec))) + + (defun file-size (file) + "Returns filesize in bytes, or NIL if it is a directory." + (cl:ignore-errors + (with-open-file (in file :direction :input) + (file-length in)))) + + (defstruct file-details name date size (desc "" :type string)) + + (defun file-date-string (file-details) + "Returns a descriptive string like \"15-Feb-2007\"." + (multiple-value-bind + (second minute hour date month year) + (decode-universal-time (file-details-date file-details)) + (declare (ignore second minute hour)) + (let ((month-names + '("Jan" "Feb" "Mar" "Apr" "May" "Jun" + "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"))) + (format nil "~2,'0d-~A-~D" + date (nth (1- month) month-names) year)))) + + (defun file-size-string (file-details) + "Returns a descriptive string like \"1.3K\" or \"8M\"." + (let ((size (file-details-size file-details))) + (cond ((not (numberp size)) "- ") + ((< size 1024) (format nil "~D " size)) + ((< size (* 1024 1024)) (format nil "~,1FK" (/ size 1024))) + (t (format nil "~,1FM" (/ size (* 1024 1024))))))) + + (defun maybe-integer-lessp (a b) + "If both a & b are numbers, then it's just like #'< + Otherwise, non number goes first." + (cond ((and (numberp a) (numberp b)) + (< a b)) + ((numberp b) t) + (t nil))) + + (defun sort-file-details (list &optional (sort-column "N") (sort-order "A")) + "Sort file-details based on sort column and order." + (let* ((sort-column (intern sort-column :keyword)) + (compare-func + (ecase sort-column + ((:M :S) #'maybe-integer-lessp) + ((:N :D) #'string-lessp))) + (selector + (ecase sort-column + (:N #'file-details-name) + (:M #'file-details-date) + (:S #'file-details-size) + (:D #'file-details-desc))) + (results (sort list compare-func :key selector))) + (if (string-equal sort-order "D") + (nreverse results) + results))) + + (defun redirect-if-malformed-pathspec () + "Directory listing request should end in a forward slash like + \"http://localhost/hunchentoot/code/\". Fix it if it is not the + case." + (let* ((script-name (script-name)) + (length (length script-name))) + (unless (and (> length 0) + (char= (aref script-name (1- length)) #\/)) + ;; stripping the query string is OK + (redirect (concatenate 'string script-name "/"))))) + + (defun folder-index-page (pathname) + "Returns a html page with a directory listing like those generated + by Apache." + (redirect-if-malformed-pathspec) + (let* ((contents (directory (namestring pathname))) + (title (format nil "Index of ~A" (script-name))) + (sort-column (get-parameter "C")) + (sort-order (get-parameter "O"))) + (flet ((file-details (file) + (make-file-details :name (enough-namestring file pathname) + :date (file-write-date file) + :size (file-size file)))) + ;; taint get-parameters + (unless (member sort-column '("N" "M" "S" "D") :test #'string-equal) + (setq sort-column "N")) + (unless (member sort-order '("A" "D") :test #'string-equal) + (setq sort-order "A")) + ;; page-out + (with-output-to-string (out) + (format out "~A +

~A

" title title) + ;; column headers + (loop for (query-char desc) in + '(("N" "Name") + ("M" "Last modified") + ("S" "Size") + ("D" "Description")) do + (format out "" + query-char + (or (when (string-equal query-char sort-column) + (if (string-equal sort-order "D") "A" "D")) + "A") + desc)) + (format out " + + ") + (dolist (d (sort-file-details + (mapcar #'file-details contents) + sort-column sort-order)) + (format out "" + (file-details-name d) (file-details-name d)) + (format out "" + (file-date-string d) + (file-size-string d) + (file-details-desc d))) + (format out "
~A

Parent Directory
~A~A~A~A

+

~A

" (address-string)))))) + (defun create-folder-dispatcher-and-handler (uri-prefix base-path &optional content-type) "Creates and returns a dispatch function which will dispatch to a handler function which emits the file relative to BASE-PATH that is *************** *** 203,209 **** always (stringp component)))) (setf (return-code) +http-forbidden+) (throw 'handler-done nil)) ! (handle-static-file (merge-pathnames script-path base-path) content-type)))) (create-prefix-dispatcher uri-prefix #'handler))) (defun no-cache () --- 336,345 ---- always (stringp component)))) (setf (return-code) +http-forbidden+) (throw 'handler-done nil)) ! (let ((pathname (probe-file (merge-pathnames script-path base-path)))) ! (if (and pathname (directory-pathname-p pathname)) ! (folder-index-page pathname) ! (handle-static-file pathname content-type)))))) (create-prefix-dispatcher uri-prefix #'handler))) (defun no-cache () ==== hunchentoot/test/test.lisp#1 - hunchentoot/test/test.lisp ==== *************** *** 501,506 **** --- 501,508 ---- " (user 'nanook', password 'igloo')")) (:tr (:td (:a :href "/hunchentoot/code/test.lisp" "The source code of this test"))) + (:tr (:td (:a :href "/hunchentoot/code/" + "Listing of the code directory"))) (:tr (:td (:a :href "/hunchentoot/test/image.jpg" "Binary data, delivered from file") " \(a picture)")) -------------- next part -------------- A non-text attachment was scrubbed... Name: misc.lisp Type: application/octet-stream Size: 18253 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.lisp Type: application/octet-stream Size: 24018 bytes Desc: not available URL: From nowhere.man at levallois.eu.org Fri Feb 16 03:20:47 2007 From: nowhere.man at levallois.eu.org (Pierre THIERRY) Date: Fri, 16 Feb 2007 04:20:47 +0100 Subject: [hunchentoot-devel] folder-dispatcher directory listing In-Reply-To: <4877ae640702151835x60eeb866ycf0555c7393434bc@mail.gmail.com> References: <4877ae640702151835x60eeb866ycf0555c7393434bc@mail.gmail.com> Message-ID: <20070216032047.GH7532@bateleur.arcanes.fr.eu.org> Scribit Mac Chan dies 15/02/2007 hora 18:35: > (PS The code should look less horrible if cl-who is available but it's > really a pain since I don't want to introduce dependencies to > hunchentoot. There is one function copied directly from cl-fad for the > same reason) Why not make it a small separate package depending on cl-fad and cl-who, then? Alternatively, Pierre -- nowhere.man at levallois.eu.org OpenPGP 0xD9D50D8A -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From emailmac at gmail.com Fri Feb 16 03:28:31 2007 From: emailmac at gmail.com (Mac Chan) Date: Thu, 15 Feb 2007 19:28:31 -0800 Subject: [hunchentoot-devel] folder-dispatcher directory listing In-Reply-To: <20070216032047.GH7532@bateleur.arcanes.fr.eu.org> References: <4877ae640702151835x60eeb866ycf0555c7393434bc@mail.gmail.com> <20070216032047.GH7532@bateleur.arcanes.fr.eu.org> Message-ID: <4877ae640702151928y343a1eccqe56ac1c09fe4eaa2@mail.gmail.com> On 2/15/07, Pierre THIERRY wrote: > Why not make it a small separate package depending on cl-fad and cl-who, > then? > > Alternatively, > Pierre I've seen Edi dump html directly in several places, so I guess it's a ok trade-off. Anyway, turns out that #'directory behaves quite differently in sbcl (and other lisps), and the patch submitted earlier only works on lispworks. So after all I need to pull in cl-fad, I'm not sure if this is a bad thing... -- Mac -------------- next part -------------- A non-text attachment was scrubbed... Name: hunchentoot.asd Type: application/octet-stream Size: 3068 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: misc.lisp Type: application/octet-stream Size: 17760 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.lisp Type: application/octet-stream Size: 24018 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- diff hunchentoot-0.6.1/hunchentoot.asd hunchentoot/hunchentoot.asd 47a48 > :cl-fad diff hunchentoot-0.6.1/misc.lisp hunchentoot/misc.lisp 140,141c140,142 < (unless (or (pathname-name path) < (pathname-type path)) --- > (unless (and path > (or (pathname-name path) > (pathname-type path))) 179a181,300 > (defun file-size (file) > "Returns filesize in bytes, or NIL if it is a directory." > (cl:ignore-errors > (with-open-file (in file :direction :input) > (file-length in)))) > > (defstruct file-details name date size (desc "" :type string)) > > (defun file-date-string (file-details) > "Returns a descriptive string like \"15-Feb-2007\"." > (multiple-value-bind > (second minute hour date month year) > (decode-universal-time (file-details-date file-details)) > (declare (ignore second minute hour)) > (let ((month-names > '("Jan" "Feb" "Mar" "Apr" "May" "Jun" > "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"))) > (format nil "~2,'0d-~A-~D" > date (nth (1- month) month-names) year)))) > > (defun file-size-string (file-details) > "Returns a descriptive string like \"1.3K\" or \"8M\"." > (let ((size (file-details-size file-details))) > (cond ((not (numberp size)) "- ") > ((< size 1024) (format nil "~D " size)) > ((< size (* 1024 1024)) (format nil "~,1FK" (/ size 1024))) > (t (format nil "~,1FM" (/ size (* 1024 1024))))))) > > (defun maybe-integer-lessp (a b) > "If both a & b are numbers, then it's just like #'< > Otherwise, non number goes first." > (cond ((and (numberp a) (numberp b)) > (< a b)) > ((numberp b) t) > (t nil))) > > (defun sort-file-details (list &optional (sort-column "N") (sort-order "A")) > "Sort file-details based on sort column and order." > (let* ((sort-column (intern sort-column :keyword)) > (compare-func > (ecase sort-column > ((:M :S) #'maybe-integer-lessp) > ((:N :D) #'string-lessp))) > (selector > (ecase sort-column > (:N #'file-details-name) > (:M #'file-details-date) > (:S #'file-details-size) > (:D #'file-details-desc))) > (results (sort list compare-func :key selector))) > (if (string-equal sort-order "D") > (nreverse results) > results))) > > (defun redirect-if-malformed-pathspec () > "Directory listing request should end in a forward slash like > \"http://localhost/hunchentoot/code/\". Fix it if it is not the > case." > (let* ((script-name (script-name)) > (length (length script-name))) > (unless (and (> length 0) > (char= (aref script-name (1- length)) #\/)) > ;; stripping the query string is OK > (redirect (concatenate 'string script-name "/"))))) > > (defun folder-index-page (pathname) > "Returns a html page with a directory listing like those generated > by Apache." > (redirect-if-malformed-pathspec) > (let* ((contents (cl-fad:list-directory (namestring pathname))) > (title (format nil "Index of ~A" (script-name))) > (sort-column (get-parameter "C")) > (sort-order (get-parameter "O"))) > (flet ((file-details (file) > (make-file-details :name (enough-namestring file pathname) > :date (file-write-date file) > :size (file-size file)))) > ;; taint get-parameters > (unless (member sort-column '("N" "M" "S" "D") :test #'string-equal) > (setq sort-column "N")) > (unless (member sort-order '("A" "D") :test #'string-equal) > (setq sort-order "A")) > ;; page-out > (with-output-to-string (out) > (format out "~A >

~A

" title title) > ;; column headers > (loop for (query-char desc) in > '(("N" "Name") > ("M" "Last modified") > ("S" "Size") > ("D" "Description")) do > (format out "" > query-char > (or (when (string-equal query-char sort-column) > (if (string-equal sort-order "D") "A" "D")) > "A") > desc)) > (format out " > > ") > (dolist (d (sort-file-details > (mapcar #'file-details contents) > sort-column sort-order)) > (format out "" > (file-details-name d) (file-details-name d)) > (format out "" > (file-date-string d) > (file-size-string d) > (file-details-desc d))) > (format out "
~A

Parent Directory
~A~A~A~A

>

~A

" (address-string)))))) > 206c327,330 < (handle-static-file (merge-pathnames script-path base-path) content-type)))) --- > (let ((pathname (probe-file (merge-pathnames script-path base-path)))) > (if (and pathname (cl-fad:directory-pathname-p pathname)) > (folder-index-page pathname) > (handle-static-file pathname content-type)))))) diff hunchentoot-0.6.1/test/test.lisp hunchentoot/test/test.lisp 503a504,505 > (:tr (:td (:a :href "/hunchentoot/code/" > "Listing of the code directory"))) diff hunchentoot-0.6.1/doc/index.html hunchentoot/doc/index.html 128c128 <
  • and my own Chunga, CL-PPCRE, and URL-REWRITE (plus CL-WHO for the example code). --- >
  • and my own Chunga, CL-PPCRE, CL-FAD, and URL-REWRITE (plus CL-WHO for the example code). From edi at agharta.de Fri Feb 16 08:13:43 2007 From: edi at agharta.de (Edi Weitz) Date: Fri, 16 Feb 2007 09:13:43 +0100 Subject: [hunchentoot-devel] folder-dispatcher directory listing In-Reply-To: <4877ae640702151928y343a1eccqe56ac1c09fe4eaa2@mail.gmail.com> (Mac Chan's message of "Thu, 15 Feb 2007 19:28:31 -0800") References: <4877ae640702151835x60eeb866ycf0555c7393434bc@mail.gmail.com> <20070216032047.GH7532@bateleur.arcanes.fr.eu.org> <4877ae640702151928y343a1eccqe56ac1c09fe4eaa2@mail.gmail.com> Message-ID: On Thu, 15 Feb 2007 19:28:31 -0800, "Mac Chan" wrote: > I've seen Edi dump html directly in several places, so I guess it's > a ok trade-off. > > Anyway, turns out that #'directory behaves quite differently in sbcl > (and other lisps), and the patch submitted earlier only works on > lispworks. > > So after all I need to pull in cl-fad, I'm not sure if this is a bad > thing... I agree with Pierre that this would be best kept in a separate library. (And this is by the way also what Apache does - directory listings are in a separate module IIRC.) I can give you access to the CVS repository on common-lisp.net if you want to host the code there. Let me know. Thanks for the contribution, Edi. From dl at znain.net Sun Feb 18 11:57:31 2007 From: dl at znain.net (dl) Date: Sun, 18 Feb 2007 06:57:31 -0500 Subject: [hunchentoot-devel] folder-dispatcher directory listing In-Reply-To: (Edi Weitz's message of "Fri, 16 Feb 2007 09:13:43 +0100") References: <4877ae640702151835x60eeb866ycf0555c7393434bc@mail.gmail.com> <20070216032047.GH7532@bateleur.arcanes.fr.eu.org> <4877ae640702151928y343a1eccqe56ac1c09fe4eaa2@mail.gmail.com> Message-ID: <81hctjel04.fsf@oh177.znain.com> Edi Weitz writes: > I agree with Pierre that this would be best kept in a separate > library. (And this is by the way also what Apache does - directory > listings are in a separate module IIRC.) Some time ago I wrote a small directory listing utility as a separate package for my own use: I guess other people might find it useful too, so I've just put it for download at this address: http://site.znain.com/dl/lisp/hunchentoot-dir-lister/ You can also try it live here: a simple listing: http://znain.com:8082/hunchentoot-dir-lister/ or here: a "zebra table" listing: http://znain.com:8082/hunchentoot-dir-lister-zebra/ -- dimitre liotev From dl at znain.net Sun Feb 18 12:18:42 2007 From: dl at znain.net (dl) Date: Sun, 18 Feb 2007 07:18:42 -0500 Subject: [hunchentoot-devel] folder-dispatcher directory listing In-Reply-To: <81hctjel04.fsf@oh177.znain.com> (dl@znain.net's message of "Sun, 18 Feb 2007 06:57:31 -0500") References: <4877ae640702151835x60eeb866ycf0555c7393434bc@mail.gmail.com> <20070216032047.GH7532@bateleur.arcanes.fr.eu.org> <4877ae640702151928y343a1eccqe56ac1c09fe4eaa2@mail.gmail.com> <81hctjel04.fsf@oh177.znain.com> Message-ID: <81abzbek0t.fsf@oh177.znain.com> dl
    writes: > Edi Weitz writes: > >> I agree with Pierre that this would be best kept in a separate >> library. (And this is by the way also what Apache does - directory >> listings are in a separate module IIRC.) > > Some time ago I wrote a small directory listing utility as a separate > package for my own use: I guess other people might find it useful too, > so I've just put it for download at this address: > > http://site.znain.com/dl/lisp/hunchentoot-dir-lister/ > > You can also try it live here: > > a simple listing: > http://znain.com:8082/hunchentoot-dir-lister/ > > or here: > > a "zebra table" listing: > http://znain.com:8082/hunchentoot-dir-lister-zebra/ By the way, I've only tested it with SBCL and Firefox on Linux. -- dimitre liotev From edi at agharta.de Sun Feb 18 20:19:16 2007 From: edi at agharta.de (Edi Weitz) Date: Sun, 18 Feb 2007 21:19:16 +0100 Subject: [hunchentoot-devel] folder-dispatcher directory listing In-Reply-To: <81hctjel04.fsf@oh177.znain.com> (dl@znain.net's message of "Sun, 18 Feb 2007 06:57:31 -0500") References: <4877ae640702151835x60eeb866ycf0555c7393434bc@mail.gmail.com> <20070216032047.GH7532@bateleur.arcanes.fr.eu.org> <4877ae640702151928y343a1eccqe56ac1c09fe4eaa2@mail.gmail.com> <81hctjel04.fsf@oh177.znain.com> Message-ID: On Sun, 18 Feb 2007 06:57:31 -0500, dl
    wrote: > Some time ago I wrote a small directory listing utility as a > separate package for my own use: I guess other people might find it > useful too, so I've just put it for download at this address: > > http://site.znain.com/dl/lisp/hunchentoot-dir-lister/ Nice, thanks. I've added a link to the Hunchentoot home page. From jmckitrick at reedlarkeygroup.com Tue Feb 20 16:03:10 2007 From: jmckitrick at reedlarkeygroup.com (Jonathon McKitrick) Date: Tue, 20 Feb 2007 11:03:10 -0500 (EST) Subject: [hunchentoot-devel] Where to set up a shared hunchentoot directory Message-ID: <49680.68.44.154.215.1171987390.squirrel@reedlarkeygroup.com> I've been running a production site from my home directory, and it's about time I change that. Are there suggested setup locations and/or permissions to run hunchentoot from a shared directory? I'm sure there are many ways to do it, but I thought I'd ask those of you who have perhaps encountered and dealt with some unforeseen issues and would share that with us. -- Jonathon McKitrick Reed Larkey Group From urym at two-bytes.com Tue Feb 20 17:53:26 2007 From: urym at two-bytes.com (Ury Marshak) Date: Tue, 20 Feb 2007 19:53:26 +0200 Subject: [hunchentoot-devel] Ajax library for Hunchentoot In-Reply-To: References: Message-ID: <45DB3596.3060302@two-bytes.com> Edi Weitz wrote: > Ury Marshak has written an Ajax framework for Hunchentoot which you > can find here: Thank you, Edi! I've actually planned on asking you if this would be of interest to the list, so I guess you've answered that :) It'd be great if you could have a look at it, I'd be glad to hear any comments and critique. In the meantime I've updated HT-AJAX with some new stuff, like support for Dojo and Yahoo UI libraries, JSON, "virtual .js files", etc. Cheers, Ury From tobia.conforto at linux.it Tue Feb 20 18:09:24 2007 From: tobia.conforto at linux.it (Tobia) Date: Tue, 20 Feb 2007 19:09:24 +0100 Subject: [hunchentoot-devel] Where to set up a shared hunchentoot directory In-Reply-To: <49680.68.44.154.215.1171987390.squirrel@reedlarkeygroup.com> References: <49680.68.44.154.215.1171987390.squirrel@reedlarkeygroup.com> Message-ID: <20070220180924.GR4761@localhost.localdomain> Jonathon McKitrick scrisse: > I've been running a production site from my home directory, and it's > about time I change that. > > Are there suggested setup locations and/or permissions to run > hunchentoot from a shared directory? Going with time-honored (!) GNU/Linux practice, I would suggest: - Lisp subsystem (base image and system libraries) installed in a system directory, such as /usr if managed through the system package manager, /usr/local or /opt otherwise; in any case owned by root and not writable by others; - Website-specific files (both lisp files defining handlers and static files) under /var/www or /srv; owned by root and not writable by others, with the exception of the directories (if any) where the application should write (directory for uploaded files, etc.) alternatively, the lisp files might go in /usr/local/cgi-bin or such; - Hunchentoot system files (= Edi's distribution, if unmodified) in a local system directory (/usr/local or such), preferably one advocated by the particular Lisp subsystem; same permissions as above; alternatively, they might be installed together with the website- specific lisp files; - Make the Hunchentoot server do a chuid to a user created for the purpose, with password and login shell disabled; this user should only have write access if and where appropriate (upload directory, etc.) This assumes that you're not running it inside a chroot and that the Lisp subsystem manages compiled files on its own, usually somewhere in /var; otherwise things get ugly pretty fast ;-) Tobia From saurabhnanda at gmail.com Wed Feb 21 09:37:21 2007 From: saurabhnanda at gmail.com (Saurabh Nanda) Date: Wed, 21 Feb 2007 15:07:21 +0530 Subject: [hunchentoot-devel] HTTP redirect bug in Allegro Lisp Message-ID: <794f042d0702210137n7c09d6bfm90834528aab6a65c@mail.gmail.com> Hi, I have a piece of code which runs in SBCL but is throwing an error when running on Allegro Lisp. The relevant portion of the backtrace thrown by hunchentoot is given below: ->(SYS::..RUNTIME-OPERATION . :UNKNOWN-ARGS) (TPL:DO-COMMAND "zoom" :FROM-READ-EVAL-PRINT-LOOP NIL :COUNT T :ALL T) (TBNL:GET-BACKTRACE #1=#) ((:INTERNAL TBNL::PROCESS-REQUEST 0) #1#) (SIGNAL #1#) (ERROR SIMPLE-ERROR :FORMAT-CONTROL "Attempt to store into purespace address #x~x." :FORMAT-ARGUMENTS #2=(182935334912)) (EXCL::ERROR-FROM-CODE 19 . #2#) (SYS::..CONTEXT-SAVING-RUNTIME-OPERATION) (NSTRING-UPCASE #3="Location") (TBNL::MAKE-KEYWORD #3#) (TBNL:REDIRECT "http://URL-DELETED") In the make-keyword function. changing the default value of the parameter destructivep to 'nil' solves this error. Is this a bug? Or what? Nandz. -- http://nandz.blogspot.com http://foodieforlife.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nowhere.man at levallois.eu.org Wed Feb 21 15:04:35 2007 From: nowhere.man at levallois.eu.org (Pierre THIERRY) Date: Wed, 21 Feb 2007 16:04:35 +0100 Subject: [hunchentoot-devel] HTTP redirect bug in Allegro Lisp In-Reply-To: <794f042d0702210137n7c09d6bfm90834528aab6a65c@mail.gmail.com> References: <794f042d0702210137n7c09d6bfm90834528aab6a65c@mail.gmail.com> Message-ID: <20070221150435.GK7457@bateleur.arcanes.fr.eu.org> Scribit Saurabh Nanda dies 21/02/2007 hora 15:07: > I have a piece of code which runs in SBCL but is throwing an error > when running on Allegro Lisp. Could you also give the relevant code? The backtrace seems not very useful to me without it... Methodologically, Pierre -- nowhere.man at levallois.eu.org OpenPGP 0xD9D50D8A -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From edi at agharta.de Thu Feb 22 08:45:42 2007 From: edi at agharta.de (Edi Weitz) Date: Thu, 22 Feb 2007 09:45:42 +0100 Subject: [hunchentoot-devel] New release 0.6.2 (Was: HTTP redirect bug in Allegro Lisp) In-Reply-To: <794f042d0702210137n7c09d6bfm90834528aab6a65c@mail.gmail.com> (Saurabh Nanda's message of "Wed, 21 Feb 2007 15:07:21 +0530") References: <794f042d0702210137n7c09d6bfm90834528aab6a65c@mail.gmail.com> Message-ID: On Wed, 21 Feb 2007 15:07:21 +0530, "Saurabh Nanda" wrote: > I have a piece of code which runs in SBCL but is throwing an error > when running on Allegro Lisp. The relevant portion of the backtrace > thrown by hunchentoot is given below: > > ->(SYS::..RUNTIME-OPERATION . :UNKNOWN-ARGS) > (TPL:DO-COMMAND "zoom" :FROM-READ-EVAL-PRINT-LOOP NIL :COUNT T :ALL > T) > (TBNL:GET-BACKTRACE #1=#) > ((:INTERNAL TBNL::PROCESS-REQUEST 0) #1#) > (SIGNAL #1#) > (ERROR SIMPLE-ERROR :FORMAT-CONTROL > "Attempt to store into purespace address #x~x." > :FORMAT-ARGUMENTS #2=(182935334912)) > (EXCL::ERROR-FROM-CODE 19 . #2#) > (SYS::..CONTEXT-SAVING-RUNTIME-OPERATION) (NSTRING-UPCASE #3="Location") > (TBNL::MAKE-KEYWORD #3#) > (TBNL:REDIRECT "http://URL-DELETED") > > In the make-keyword function. changing the default value of the > parameter destructivep to 'nil' solves this error. > > Is this a bug? Or what? Yes, that was clearly a bug - 0.6.2 fixes that. Thanks for the report, Edi. From edi at agharta.de Thu Feb 22 23:35:54 2007 From: edi at agharta.de (Edi Weitz) Date: Fri, 23 Feb 2007 00:35:54 +0100 Subject: [hunchentoot-devel] Darcs repositories Message-ID: [My apologies if you get this more than once.] Several people have asked for Darcs repositories of my software. These do exists now: http://common-lisp.net/~loliveira/ediware/ Special thanks to Lu?s Oliveira who made this possible and who maintains the repositories. Cheers, Edi. From nowhere.man at levallois.eu.org Fri Feb 23 01:11:25 2007 From: nowhere.man at levallois.eu.org (Pierre THIERRY) Date: Fri, 23 Feb 2007 02:11:25 +0100 Subject: [hunchentoot-devel] Re: Mercurial repositories In-Reply-To: References: <7EB05352-CA54-4431-9CE3-73AE8D913992@bobobeach.com> <20070119003232.GC16524@bateleur.arcanes.fr.eu.org> <20070215024100.GA7532@bateleur.arcanes.fr.eu.org> Message-ID: <20070223011125.GK7500@bateleur.arcanes.fr.eu.org> I'm about to convert hunchentoot's history to Mercurial. Did I miss any released version, I have: - 0.4.[0-12] - 0.5.[0-1] - 0.6.[0-2] Cautiously, Pierre -- nowhere.man at levallois.eu.org OpenPGP 0xD9D50D8A -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From edi at agharta.de Fri Feb 23 08:08:40 2007 From: edi at agharta.de (Edi Weitz) Date: Fri, 23 Feb 2007 09:08:40 +0100 Subject: [hunchentoot-devel] Re: Mercurial repositories In-Reply-To: <20070223011125.GK7500@bateleur.arcanes.fr.eu.org> (Pierre THIERRY's message of "Fri, 23 Feb 2007 02:11:25 +0100") References: <7EB05352-CA54-4431-9CE3-73AE8D913992@bobobeach.com> <20070119003232.GC16524@bateleur.arcanes.fr.eu.org> <20070215024100.GA7532@bateleur.arcanes.fr.eu.org> <20070223011125.GK7500@bateleur.arcanes.fr.eu.org> Message-ID: On Fri, 23 Feb 2007 02:11:25 +0100, Pierre THIERRY wrote: > I'm about to convert hunchentoot's history to Mercurial. Did I miss > any released version, I have: > > - 0.4.[0-12] > - 0.5.[0-1] > - 0.6.[0-2] There should be some more (0.4.[13-14] and 0.1.0 to 0.3.2): http://weitz.de/hunchentoot/CHANGELOG Cheers, Edi. From nowhere.man at levallois.eu.org Sat Feb 24 22:34:07 2007 From: nowhere.man at levallois.eu.org (Pierre THIERRY) Date: Sat, 24 Feb 2007 23:34:07 +0100 Subject: [hunchentoot-devel] Re: Mercurial repositories In-Reply-To: References: <7EB05352-CA54-4431-9CE3-73AE8D913992@bobobeach.com> <20070119003232.GC16524@bateleur.arcanes.fr.eu.org> <20070215024100.GA7532@bateleur.arcanes.fr.eu.org> <20070223011125.GK7500@bateleur.arcanes.fr.eu.org> Message-ID: <20070224223407.GU7500@bateleur.arcanes.fr.eu.org> Scribit Edi Weitz dies 23/02/2007 hora 09:08: > > I'm about to convert hunchentoot's history to Mercurial. Did I miss > > any released version, I have: > > > > - 0.4.[0-12] - 0.5.[0-1] - 0.6.[0-2] > > There should be some more (0.4.[13-14] and 0.1.0 to 0.3.2): I tailored the CVS that you sent me to Mercurial. Tailor made 95 revisions from the CVS history, with the following tags (tip is CVS's HEAD): tip 94:78a1ee48145a v0_4_12a 91:9924c504f990 v0_4_12 89:0eb6be2ef96c v0_4_11 87:7b75c61273fc v0_4_10 85:0c7490a6f44f v0_4_10a 84:83c6708799c8 v0_4_9 82:655bf0497aba v0_4_8 80:783b4329beed v0_4_7 77:5db448c76456 v0_4_6 75:ed5bd153eb0f v0_4_5 70:f00b9f695a1f v0_4_4 64:61f994bc1601 v0_4_3 60:c83530b7585a v0_4_2 56:9b22345c9dbb v0_4_1 54:a3947418430a v0_4_0 51:cbdd37106c9c test2 49:86c23e4f46d5 beta4 34:7081f12b95bf beta3 22:c2289f6442f7 beta2 13:3851ecf907cf cl 11:f603e2691360 Edi 0:da8577174ba5 Did my conversion tool missed something? (if yes, maybe it would help me debug the problem if you could tell me where the missing versions should appear) Partially, Pierre -- nowhere.man at levallois.eu.org OpenPGP 0xD9D50D8A -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From edi at agharta.de Sun Feb 25 10:16:43 2007 From: edi at agharta.de (Edi Weitz) Date: Sun, 25 Feb 2007 11:16:43 +0100 Subject: [hunchentoot-devel] Re: Mercurial repositories In-Reply-To: <20070224223407.GU7500@bateleur.arcanes.fr.eu.org> (Pierre THIERRY's message of "Sat, 24 Feb 2007 23:34:07 +0100") References: <7EB05352-CA54-4431-9CE3-73AE8D913992@bobobeach.com> <20070119003232.GC16524@bateleur.arcanes.fr.eu.org> <20070215024100.GA7532@bateleur.arcanes.fr.eu.org> <20070223011125.GK7500@bateleur.arcanes.fr.eu.org> <20070224223407.GU7500@bateleur.arcanes.fr.eu.org> Message-ID: On Sat, 24 Feb 2007 23:34:07 +0100, Pierre THIERRY wrote: > I tailored the CVS that you sent me to Mercurial. Tailor made 95 > revisions from the CVS history, with the following tags (tip is CVS's > HEAD): > > tip 94:78a1ee48145a > v0_4_12a 91:9924c504f990 > v0_4_12 89:0eb6be2ef96c > v0_4_11 87:7b75c61273fc > v0_4_10 85:0c7490a6f44f > v0_4_10a 84:83c6708799c8 > v0_4_9 82:655bf0497aba > v0_4_8 80:783b4329beed > v0_4_7 77:5db448c76456 > v0_4_6 75:ed5bd153eb0f > v0_4_5 70:f00b9f695a1f > v0_4_4 64:61f994bc1601 > v0_4_3 60:c83530b7585a > v0_4_2 56:9b22345c9dbb > v0_4_1 54:a3947418430a > v0_4_0 51:cbdd37106c9c > test2 49:86c23e4f46d5 > beta4 34:7081f12b95bf > beta3 22:c2289f6442f7 > beta2 13:3851ecf907cf > cl 11:f603e2691360 > Edi 0:da8577174ba5 > > Did my conversion tool missed something? (if yes, maybe it would > help me debug the problem if you could tell me where the missing > versions should appear) Hmm, it seems the versions before 0.4.0 were in a different CVS repository that I've thrown away since - sorry for that. Of course, what comes after 0.4.12 isn't in there as I sent it some time ago already. From nowhere.man at levallois.eu.org Sun Feb 25 18:53:39 2007 From: nowhere.man at levallois.eu.org (Pierre THIERRY) Date: Sun, 25 Feb 2007 19:53:39 +0100 Subject: [hunchentoot-devel] Re: Mercurial repositories In-Reply-To: References: <7EB05352-CA54-4431-9CE3-73AE8D913992@bobobeach.com> <20070119003232.GC16524@bateleur.arcanes.fr.eu.org> <20070215024100.GA7532@bateleur.arcanes.fr.eu.org> <20070223011125.GK7500@bateleur.arcanes.fr.eu.org> <20070224223407.GU7500@bateleur.arcanes.fr.eu.org> Message-ID: <20070225185339.GX7500@bateleur.arcanes.fr.eu.org> Scribit Edi Weitz dies 25/02/2007 hora 11:16: > Hmm, it seems the versions before 0.4.0 were in a different CVS > repository that I've thrown away since - sorry for that. Too bad. > Of course, what comes after 0.4.12 isn't in there as I sent it some > time ago already. Yes, I didn't track released versions immediately. Could you send me either the current CVS or the two versions I missed? Quickly, Pierre -- nowhere.man at levallois.eu.org OpenPGP 0xD9D50D8A -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From lam at tuxfamily.org Mon Feb 26 19:11:27 2007 From: lam at tuxfamily.org (Nicolas Lamirault) Date: Mon, 26 Feb 2007 20:11:27 +0100 Subject: [hunchentoot-devel] Question about error handler. Message-ID: <877iu47mzk.fsf@no-log.org> hi all i make my website with hunchentoot. it works very fine. My database backend could throw some conditions (db-connect-error, db-...-error, ...), and i would like to print the error message. i have modify the default error handler like this : (defun handle-error (arg) "Modify the Hunchentoot error dispatcher." ;;(declare (ignore arg)) (make-web-page #p"error.html" (list :message (format nil "~A" arg)))) and the HTML template :
    Error
    Internal error :
    in the final web page i see :
    Error
    Internal error : 500 i would like to print a customized error message. it is possible ? i try to modify my code like this : (handler-case (progn ...) (db-connect-error (cond) (setf (hunchentoot:session-value 'error-msg) cond) (hunchentoot:redirect "/test-lam/index")) ...) he index-handler which print the error message but it doesn't works. The customize error handler catch the exception before someone knows how could i make this ? thanks for any help. -- Nicolas Lamirault From edi at agharta.de Mon Feb 26 20:14:27 2007 From: edi at agharta.de (Edi Weitz) Date: Mon, 26 Feb 2007 21:14:27 +0100 Subject: [hunchentoot-devel] Question about error handler. In-Reply-To: <877iu47mzk.fsf@no-log.org> (Nicolas Lamirault's message of "Mon, 26 Feb 2007 20:11:27 +0100") References: <877iu47mzk.fsf@no-log.org> Message-ID: On Mon, 26 Feb 2007 20:11:27 +0100, Nicolas Lamirault wrote: > i would like to print a customized error message. it is possible ? Sure. > i try to modify my code like this : > > (handler-case > (progn ...) > (db-connect-error (cond) > (setf (hunchentoot:session-value 'error-msg) cond) > (hunchentoot:redirect "/test-lam/index")) > ...) > > he index-handler which print the error message but it doesn't > works. The customize error handler catch the exception before >From your example it's impossible to see where the problem is. What's in the "..." part? Are you sure the error happens in there? Are you sure it's of type DB-CONNECT-ERROR? From lam at tuxfamily.org Mon Feb 26 21:41:10 2007 From: lam at tuxfamily.org (Nicolas Lamirault) Date: Mon, 26 Feb 2007 22:41:10 +0100 Subject: [hunchentoot-devel] Question about error handler. In-Reply-To: (Edi Weitz's message of "Mon\, 26 Feb 2007 21\:14\:27 +0100") References: <877iu47mzk.fsf@no-log.org> Message-ID: <87ps7wlhqh.fsf@no-log.org> hello, thanks for reply ... Edi Weitz writes: > On Mon, 26 Feb 2007 20:11:27 +0100, Nicolas Lamirault wrote: > >> i would like to print a customized error message. it is possible ? > > Sure. > >> i try to modify my code like this : >> >> (handler-case >> (progn ...) >> (db-connect-error (cond) >> (setf (hunchentoot:session-value 'error-msg) cond) >> (hunchentoot:redirect "/test-lam/index")) >> ...) >> >> he index-handler which print the error message but it doesn't >> works. The customize error handler catch the exception before > >>From your example it's impossible to see where the problem is. What's > in the "..." part? Are you sure the error happens in there? Are you > sure it's of type DB-CONNECT-ERROR? oh thanks ! i'm writing a mail which explain my problem, with the backtrace of hunchentoot, and i find my problem ! another question : the (handler-case (progn ...) (db-connect-error (cond) (setf (hunchentoot:session-value 'error-msg) cond) (hunchentoot:redirect "/test-lam/index")) ...) works fine. But how the error dispatcher could print the error message to the template ? i could make this : (package-type-unknown-error (condition) (hunchentoot:log-message :warn "Clappa system : ~A" condition) (setf (hunchentoot:session-value 'error-msg) (clappa-system:package-type condition)) (hunchentoot:redirect "/clappa/error")) and creates a dispatcher "/clappa/error" -> error-dispatcher. But how use the error dispatcher (with one arg) : (defun handle-error (arg) "Modify the Hunchentoot error dispatcher." (declare (ignore arg)) (make-web-page #p"error.html" (list :message (format nil "~A" (hunchentoot:session-value 'error-msg))))) ? Thanks for your help ... -- Nicolas Lamirault From edi at agharta.de Mon Feb 26 21:54:02 2007 From: edi at agharta.de (Edi Weitz) Date: Mon, 26 Feb 2007 22:54:02 +0100 Subject: [hunchentoot-devel] Question about error handler. In-Reply-To: <87ps7wlhqh.fsf@no-log.org> (Nicolas Lamirault's message of "Mon, 26 Feb 2007 22:41:10 +0100") References: <877iu47mzk.fsf@no-log.org> <87ps7wlhqh.fsf@no-log.org> Message-ID: On Mon, 26 Feb 2007 22:41:10 +0100, Nicolas Lamirault wrote: > i'm writing a mail which explain my problem, with the backtrace of > hunchentoot, and i find my problem ! Yes, that has happened to me a few times as well. It's always a good idea to try to create a bug report or question as detailed as possible... :) > But how the error dispatcher could print the error message to the > template ? > > i could make this : > > (package-type-unknown-error (condition) > (hunchentoot:log-message :warn "Clappa system : ~A" condition) > (setf (hunchentoot:session-value 'error-msg) > (clappa-system:package-type condition)) > (hunchentoot:redirect "/clappa/error")) > > and creates a dispatcher "/clappa/error" -> error-dispatcher. Why don't you just have a handler (instead of a dispatcher) which handles the "/clappa/error" URI (and looks at the session value to generate a message)? You could also, BTW, store the condition itself in the session. From lam at tuxfamily.org Mon Feb 26 22:00:36 2007 From: lam at tuxfamily.org (Nicolas Lamirault) Date: Mon, 26 Feb 2007 23:00:36 +0100 Subject: [hunchentoot-devel] Question about error handler. In-Reply-To: (Edi Weitz's message of "Mon\, 26 Feb 2007 22\:54\:02 +0100") References: <877iu47mzk.fsf@no-log.org> <87ps7wlhqh.fsf@no-log.org> Message-ID: <87lkiklgu3.fsf@no-log.org> Edi Weitz writes: > On Mon, 26 Feb 2007 22:41:10 +0100, Nicolas Lamirault wrote: > >> i'm writing a mail which explain my problem, with the backtrace of >> hunchentoot, and i find my problem ! > > Yes, that has happened to me a few times as well. It's always a good > idea to try to create a bug report or question as detailed as > possible... :) yes :) >> But how the error dispatcher could print the error message to the >> template ? >> >> i could make this : >> >> (package-type-unknown-error (condition) >> (hunchentoot:log-message :warn "Clappa system : ~A" condition) >> (setf (hunchentoot:session-value 'error-msg) >> (clappa-system:package-type condition)) >> (hunchentoot:redirect "/clappa/error")) >> >> and creates a dispatcher "/clappa/error" -> error-dispatcher. > > Why don't you just have a handler (instead of a dispatcher) which > handles the "/clappa/error" URI (and looks at the session value to > generate a message)? You could also, BTW, store the condition itself > in the session. yes ... i'm trying to implements this ... thanks for your help and Hunchentoot ... > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel > -- Nicolas Lamirault