On 2010/9/13 17:11, Aaron Bedra wrote:
>  Try the following instead (just modified your attached source)
>
> (ns guestbook.core
>  (:use compojure.core)
>  (:require [compojure.route :as route])
>  (:require [ring.adapter.jetty :as jetty])
>
> (defroutes dispatcher
>   (GET "/" [] "<h1>Hello, world</h1>")
>   (route/not-found "<b>Requested resource not found</b>"))
>
> (defn -main [& args]
>   (jetty/run-jetty dispatcher {:port 8080}))

It works.  Strange gotcha.

>
> You don't need the gen class or the servlet stuff.  Also note that
> there is a compojure google group that you can join to ask more
> specific compojure based questions on.  If you want to see more
> examples I have some on github at http://github.com/abedra/clojure-web.
>

Oh, I didn't know about the Compojure group.    Just joined it.
Also nice tutorials for a person like me.  Lately, I've been wandering
around Clojure corners with no fruit.  I plan to write a business suite
with Clojure and I think web programming is a good starting point for my
case.  The tutorials show me what I want to see:  how to build web apps
step by step.

Thank you for the assist and hints Aaron.  Much appreciated.

>
> On 9/12/10 8:53 PM, Bahman Movaqar wrote:
>>   Hi list,
>>
>> I'm trying to get a simple "hello world" Compojure application
>> running.   I attach both the clj file and maven pom.xml (using
>> NetBeans+Enclojure).  When I run (guestbook.core/-main), I get a blank
>> page in browser, no matter the URL.  What am I missing?
>>
>> BTW, by "blank" I really mean blank.  If I view the page source in
>> Firefox, it's empty.

-- 
Bahman Movaqar (http://BahmanM.com)
ERP Evaluation, Implementation & Deployment Consultant

PGP Key ID: 0x3750102D (keyserver2.pgp.com)


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to