<snip>
Hi David,
I just set up a project using the configuration you've listed above
(plus lein-ring to run it).
I'm not getting the "Error: could not read data ..." message like
you've indicated.
I would suggest using Firebug to see what exactly your browser is
posting to jetty.
Regards,
Joe
Have you checked the "Breaking Changes" section of the README?
As of 0.6.0, Compojure no longer adds default middleware to routes,
but it does provide some helper functions in the compojure.handler
namespace.
Try adding the following and using it as your handler:
(def app
(compojure.handler/site my-routes))
- James
<snip>
>>
>> (defroutes my-routes
>> (GET "/" [] (form-page))
>> (POST "/" [a]
>> (if (nil? a)
>> (page [:h2 "Error: could not read data ..."])
>> (page [:h2 (str a)]))))
>>
>> Notice the POST section. Using 6.4 I get the first alternative, using
>> 4.1 I get the second. Any help getting it to work with 6.4 would be
>> much appreciated, as would any pointers to working sample code using
>> forms.
>>
>> BTW, these are the complete lein dependencies:
>> :dependencies [[org.clojure/clojure "1.2.1"]
>> [org.clojure/clojure-contrib "1.2.0"]
>> [hiccup "0.3.6"]
>> [ring/ring-jetty-adapter "0.3.10"]
>> [compojure "0.4.1"]]
>>
>
> <snip>
>
> Hi David,
>
> I just set up a project using the configuration you've listed above
> (plus lein-ring to run it).
>
> I'm not getting the "Error: could not read data ..." message like
> you've indicated.
My bad. When I change project.clj to depend on Compojure 0.6.4, I do
get your error message.
Thank you for your help. James, I saw the breaking changes note, but
I am very new to Compojure, and did not have enough context to connect
the dots. I appreciate being pointed in the right direction.
David