compojure

webjure vs compojure?

I've heard of two Clojure based web application frameworks: Webjure and Compojure. Can someone let me know which is better? ...

Deploying Compojure/Sinatra Applications.

What is the preferred way of deploying a compojure/sinatra applications? I have multiple sites running on the host so i can't run jetty/mongrel on port 80. How should i handle multiple sites/applications running at the same host? ...

How do I make Compojure listen to a single IP

Hi, I have started a Compojure (Jetty) server with: (defonce *server* (run-server {:host "localhost" :port 8080} "/*" (servlet routes))) but netstat still shows that it is listening on 0.0.0.0:8080, i.e. all IPs. What is the correct parameter to pass to run-server to make it listen on a single IP? ...

Compojure Templating Pages.

I have a bunch of static html files that share same header and footer. I would like to share this header and footer across all pages. For now i use the following routed but it is a bit ugly, and i have to take care of all special cases. Is there an easyway to dothis such as the php's include function? (defroutes my-app (GET "/" ...

Compojure development without web server restarts

I've written a small Swing App before in Clojure and now I'd like to create an Ajax-style Web-App. Compojure looks like the best choice right now, so that's what I'm going to try out. I'd like to have a real tiny edit/try feedback-loop, so I'd prefer not to restart the web server after each small change I do. What's the best way to a...

Compojure HTML Formatting

I'm relatively new to Clojure and a complete HTML/Compojure virgin. I'm trying to use Compojure to create static pages of HTML using a function similar to this: (defn fake-write-html [dir args] (let [file (str dir *file-separator* *index-file*) my-html (html (doctype :html4) [:html ...

WAR created using Clojure deployed on Apache Tomcat does not run Servlet

Hi, I created the sample WAR as given at the Compojure Getting Started Page and deployed it to Apache Tomcat 6.0.2 wepapps folder. The Web.xml I used is as below: <web-app> <servlet> <servlet-name>myservlet</servlet-name> <servlet-class>myapp.MyServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>myservlet</se...

Getting started with CSS in Compojure?

I found a very basic web page on the Internet and now I would like to do the obvious thing and add some CSS so I can build nicer pages. How can I include jQuery, as well as other style sheets? How can I include inline CSS so I can throw in a text-align: center, for example, to try out quick changes? Regular jQuery include: <script...

Using Clojure with Vaadin

Hi, Has anyone tried implementing a web application with Clojure ( using Compojure ) and Vaadin ? I had seen an article on using Clojure with JWT for creating web apps. Vaadin is based on GWT so you get a lot of the advantages of GWT ( though Vaadin is completely Server-centric). And Clojure gives the advantage that you can use any Java...

Create a HTML table from nested maps (and vectors)

I'm trying to create a table (a work schedule) I have coded previously using python, I think it would be a nice introduction to the Clojure language for me. I have very little experience in Clojure (or lisp in that matter) and I've done my rounds in google and a good bit of trial and error but can't seem to get my head around this style...

How to find a web hosting service for running Compojure

I am very interested in building a website using Clojure and Compojure, like so: http://briancarper.net/blog/deploying-clojure-websites However, due to my limited experience with the Java environment and Java culture, I am not sure where to begin when shopping for a web-hosting service. Do I simply need to find a service that gives me...

can rest framework like jersey be used in clojure instead of compojure

Hi , iam newbie to clojure, just curious as to can i use jersey REST api as REST webframework for clojure? all along i see people talking about compojure? if you can provide me any resource or reasoning that would be great Thank you ...

How do I stop jetty server in clojure?

I am writing a web application using ring and clojure. I am using the jetty adapter for the development server and emacs/SLIME for IDE. While wrap-reload does help, run-jetty blocks my slime session and I would like to be able to start/stop it at will without having to run it in a separate terminal session. Ideally, I would like to defin...

Stack overflow exception in compojure web project

Hi I've been playing around with clojure and have been using it to build a simple little audio player. The strange thing is that sometimes, maybe one out of twenty, when contacting the server I will get the following error: 2010-04-20 15:33:20.963::WARN: Error for /control java.lang.StackOverflowError at clojure.lang.RT.seq(RT.jav...

Using a javax.servlet.Filter with Compojure

I'm trying to build a simple web site using Clojure / Compojure and want to feed apply a servlet filter to the request / response (i.e. a standard javax.servlet.Filter instance). e.g. if the current source code is: (defroutes my-app (GET "/*" (html [:h1 "Hello Foo!!"])) ) I would like to add a filter like this: (defroutes my-a...

Wrong number of args passed to: repl$repl

Hi, I have a trouble with a compojure "Getting started" example that I do notunderstand. When I run the example from http://weavejester.github.com/compojure/docs/getting-started.html ...I get the following error at the lein repl step: ~/hello-www> lein repl src/hello_www/core.clj Exception in thread "main" java.lang.IllegalArgumentExce...

Escape/sanitize user input in Clojure/Compojure

I am using Clojure/Ring/Compojure-0.4/Enlive stack to build a web application. Are there functions in this stack that would either strip HTML or HTML-encode (i.e. <a> to &lt;a&gt;) user-supplied strings in order to prevent XSS attacks? ...

How Can I Output an HTML Comment in Compojure/Hiccup?

I'd like my program to output the following HTML: <!--[if lt IE 8]><link rel="stylesheet" href="../blueprint/ie.css" type="text/css" media="screen, projection"><![endif]--> Is there a way to output html comment literals with Hiccup? ...

Could not locate compojure in classpath

I am trying the various Getting started examples and I can get a basic hello world example working with basic HTML in the route as such (ns hello-world (:use compojure.core ring.adapter.jetty) (:require [compojure.route :as route])) (defroutes example (GET "/" [] "<h1>Hello World Wide Web!</h1>")) (run-jetty example {:port 8080}...

how does one _model_ data from relational databases in clojure ?

I have asked this question on twitter as well the #clojure IRC channel, yet got no responses. There have been several articles about Clojure-for-Ruby-programmers, Clojure-for-lisp-programmers.. but what is the missing part is Clojure for ActiveRecord programmers . There have been articles about interacting with MongoDB, Redis, etc. - ...