[tbnl-devel] Problem with my tests

Nicolas Lamirault lam at tuxfamily.org
Tue Jun 15 13:13:00 UTC 2004


hello,
il make some tests with tbnl, and i have some problems
this is how i proceed :


; SLIME 2004-04-28
CL-USER> (push "/home/nlamirault/src/cl-ini/" asdf:*central-registry*)
("/home/nlamirault/src/cl-ini/" #p"/usr/share/common-lisp/systems/"
 (MERGE-PATHNAMES #p".clc/systems/" (USER-HOMEDIR-PATHNAME))
 *DEFAULT-PATHNAME-DEFAULTS*)
CL-USER> (push "/home/nlamirault/src/url-rewrite/" asdf:*central-registry*)
("/home/nlamirault/src/url-rewrite/" "/home/nlamirault/src/cl-ini/"
 #p"/usr/share/common-lisp/systems/"
 (MERGE-PATHNAMES #p".clc/systems/" (USER-HOMEDIR-PATHNAME))
 *DEFAULT-PATHNAME-DEFAULTS*)
CL-USER> (push "/home/nlamirault/src/tbnl-0.2.3/" asdf:*central-registry*)
("/home/nlamirault/src/tbnl-0.2.3/" "/home/nlamirault/src/url-rewrite/"
 "/home/nlamirault/src/cl-ini/" #p"/usr/share/common-lisp/systems/"
 (MERGE-PATHNAMES #p".clc/systems/" (USER-HOMEDIR-PATHNAME))
 *DEFAULT-PATHNAME-DEFAULTS*)
CL-USER> (push "/home/nlamirault/src/clwl/" asdf:*central-registry*)
("/home/nlamirault/src/clwl/" "/home/nlamirault/src/tbnl-0.2.3/"
 "/home/nlamirault/src/url-rewrite/" "/home/nlamirault/src/cl-ini/"
 #p"/usr/share/common-lisp/systems/"
 (MERGE-PATHNAMES #p".clc/systems/" (USER-HOMEDIR-PATHNAME))
 *DEFAULT-PATHNAME-DEFAULTS*)
CL-USER> (asdf:operate 'asdf:load-op :clwl)

[...] 

CL-USER> (tbnl:start-tbnl)
#<KMRCL:LISTENER port 3000>



i have defined this on clwl.lisp :

(setq *dispatch-table*
      (nconc
       (mapcar (lambda (args)
                 (apply #'create-prefix-dispatcher args))
               '(("/tbnl/clwl" main)
                 ("/tnbl/clwl/login.html" login)
                 ("/tbnl/clwl/about.html" about)))
      (list #'default-dispatcher)))


on  url : http://localhost/tbnl/clwl/index.html,  i obtain  the tbnl's
default page :

> TBNL Default Page

> This the TBNL  default page. You're most likely  seeing it because the
> server administrator hasn't set up his own default page yet.

> TBNL is a  toolkit for building dynamic websites  with Common Lisp and
> Apache. More info about TBNL can be found at http://weitz.de/tbnl/.

I think that it is comportement normal because :

CL-USER> tbnl:*dispatch-table*
(TBNL:DEFAULT-DISPATCHER)


i have create an init function :

> (defun clwl ()
>   (setf *conf* (load-config "/home/nlamirault/src/clwl/clwl.conf"))
>   (setf *db* (get-database-connection *conf*))
>   (setf *dispatch-table*
>         (nconc
>          (mapcar (lambda (args)
>                    (apply #'create-prefix-dispatcher args))
>                  '(("/tbnl/clwl" main)
>                    ("/tnbl/clwl/login.html" login)
>                    ("/tbnl/clwl/about.html" about)))
>          (list #'default-dispatcher))))

CL-USER> (clwl:clwl)
; [GC threshold exceeded with 17,686,392 bytes in use.  Commencing GC.]
; [GC completed with 5,849,408 bytes retained and 11,836,984 bytes freed.]
; [GC will next occur when at least 17,849,408 bytes are in use.]
(#<Closure Over Function "DEFUN CREATE-PREFIX-DISPATCHER" {4809FD51}>
 #<Closure Over Function "DEFUN CREATE-PREFIX-DISPATCHER" {4809FD69}>
 #<Closure Over Function "DEFUN CREATE-PREFIX-DISPATCHER" {4809FD81}>
 #<Function TBNL:DEFAULT-DISPATCHER {4911B8B1}>)


after this call, the URL http://localhost/tbnl/clwl show what i want
it's ok
the logs :

[Tue Jun 15 15:08:26 2004] [warn] [TBNL] New template printer for #p"templates/blog.html" created


so  i   would  like  to   view  the  about   page  with  this   URL  :
http://localhost/tbnl/clwl/about.html, but i  have a "loop", and after
i come back to the home page :(
this is what i have on the apache logs :

[Tue Jun 15 15:08:43 2004] [error] [TBNL] Main
[Tue Jun 15 15:08:44 2004] [error] [TBNL] Main
[Tue Jun 15 15:08:45 2004] [error] [TBNL] Main
[Tue Jun 15 15:08:46 2004] [error] [TBNL] Main
[Tue Jun 15 15:08:46 2004] [error] [TBNL] Main
[Tue Jun 15 15:08:47 2004] [error] [TBNL] Main
[Tue Jun 15 15:08:47 2004] [error] [TBNL] Main
[Tue Jun 15 15:08:48 2004] [error] [TBNL] Main


PS : i have this on my functions :

(defun main ()
  (log-message :error "Main")
  ...)

(defun login ()
  (log-message :error "Login")
  ...)

(defun about ()
  (log-message :error"About clwl")
  ...)


any idea about my pb ?

thanks for any help


-- 
Nicolas Lamirault




More information about the Tbnl-devel mailing list