Hmmm. So there's this function I "borrowed" from Kenny's code:
(defun ht-monitor-page (path resource-class) (lambda (request) (trc "bingo request!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" request path resource-class) (start-session) (let ((root (or (bwhen (r (session-value 'root)) (trc "clearing updates on re-used root!!!!!!!" r) (setf (updates r) nil) r) (progn (trc "creating new web-app...") (mk-web-app (:prefix path :request (c-in request)) ;; was (c-in request) but we set that below so ??? (make-instance resource-class :fm-parent *parent*)))))) (trc "ROOT = " root) (setf (session-value 'root) root) (setf (request root) request) #+test-ht-monitor (break) ;; <<<<<<<-- See here ;; (assert (handler root)) ;; <<<<<<<-- AND HERE ! ALWAYS FAILS ! (trc "Handler is: " (describe (handler root))) (trc "******* Calling handler ") (handler root))))
My model is quite simple:
(defmd ht-monitor (page) name ip-address term
:title ":: HUNCHENTOOT MONITOR ::" :style "/css/ht-monitor.css"
:name (c? (server-name *server*)) :ip-address (c? (server-address *server*)) :term (c-in "")
:kids (c? (the-kids (mk-div () (mk-text (c? (conc$ "Name: " (name (u^ ht-monitor)))))) (mk-div () (mk-text (c? (conc$ "IP Address: " (ip-address (u^ ht- monitor)))))) (mk-div () (mk-form (:action :get) (mk-text "Input: ") (mk-input (:name "i" :id "i" :-type "text" :value (c?n (term (u^ ht-monitor))))) (mk-text (c? (conc$ "Reversed: " (reverse (term (u^ ht-monitor)))))))))))
Handler is always NIL. The assertion always fails. I could not figure out why...
Any ideas ???
Thx!
Best, Frank
Frank Goenninger wrote:
Hmmm. So there's this function I "borrowed" from Kenny's code:
(defun ht-monitor-page (path resource-class) (lambda (request) (trc "bingo request!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" request path resource-class) (start-session) (let ((root (or (bwhen (r (session-value 'root)) (trc "clearing updates on re-used root!!!!!!!" r) (setf (updates r) nil) r) (progn (trc "creating new web-app...") (mk-web-app (:prefix path :request (c-in request)) ;; was (c-in request) but we set that below so ???
I noticed that as well, never got a chance to pursue the question. I believe I tried supplying (c-in nil) as the initarg and things did not go well so I restored it to what is shown. The setf below is then an NOP when we make a new web-app because of how Cells handles non-change. I guessed that things happened during initialization that depended on having the intial request in hand. Andy will know better.
(make-instance resource-class :fm-parent *parent*)))))) (trc "ROOT = " root) (setf (session-value 'root) root) (setf (request root) request) #+test-ht-monitor (break) ;; <<<<<<<-- See here ;; (assert (handler root)) ;; <<<<<<<-- AND HERE ! ALWAYS FAILS !
That might be a bug I inserted, not understanding that some requests go to jquery and in that case openair should return nil. I took out a bit that looked for the "apropos" prefix and changed it to something ... well, I was just thrashing and reacted badly to something that looked wrong but probably was nominal.
kt
(trc "Handler is: " (describe (handler root))) (trc "******* Calling handler ") (handler root))))
My model is quite simple:
(defmd ht-monitor (page) name ip-address term
:title ":: HUNCHENTOOT MONITOR ::" :style "/css/ht-monitor.css"
:name (c? (server-name *server*)) :ip-address (c? (server-address *server*)) :term (c-in "")
:kids (c? (the-kids (mk-div () (mk-text (c? (conc$ "Name: " (name (u^ ht-monitor)))))) (mk-div () (mk-text (c? (conc$ "IP Address: " (ip-address (u^ ht- monitor)))))) (mk-div () (mk-form (:action :get) (mk-text "Input: ") (mk-input (:name "i" :id "i" :-type "text" :value (c?n (term (u^ ht-monitor))))) (mk-text (c? (conc$ "Reversed: " (reverse (term (u^ ht-monitor)))))))))))
Handler is always NIL. The assertion always fails. I could not figure out why...
Any ideas ???
Thx!
Best, Frank
cells-devel site list cells-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cells-devel